Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
rkodev committed Feb 5, 2024
1 parent e9b8a0d commit 626cd39
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public override void WriteCodeElement(CodeEnum codeElement, LanguageWriter write
"const (");
writer.IncreaseIndent();
var isMultiValue = codeElement.Flags;

var iotaSuffix = $" {typeName} = iota";

var enumOptions = codeElement.Options;
int power = 0;
foreach (var item in enumOptions)
Expand All @@ -41,10 +40,7 @@ public override void WriteCodeElement(CodeEnum codeElement, LanguageWriter write
if (isMultiValue)
writer.WriteLine($"{item.Name.ToUpperInvariant()}_{typeName.ToUpperInvariant()} = {(int)Math.Pow(2, power)}");
else
writer.WriteLine($"{item.Name.ToUpperInvariant()}_{typeName.ToUpperInvariant()}{iotaSuffix}");

if (!string.IsNullOrEmpty(iotaSuffix))
iotaSuffix = string.Empty;
writer.WriteLine($"{item.Name.ToUpperInvariant()}_{typeName.ToUpperInvariant()}{(power == 0 ? $" {typeName} = iota" : string.Empty)}");

power++;
}
Expand Down

0 comments on commit 626cd39

Please sign in to comment.