From 626cd3935783167a9622b4e48f53c72b7f1d9a3f Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:45:04 +0300 Subject: [PATCH] Format code --- src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs b/src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs index 04a51e3504..4da36f63c7 100644 --- a/src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs +++ b/src/Kiota.Builder/Writers/Go/CodeEnumWriter.cs @@ -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) @@ -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++; }