diff --git a/generator/language.go b/generator/language.go
index <HASH>..<HASH> 100644
--- a/generator/language.go
+++ b/generator/language.go
@@ -262,7 +262,7 @@ func GoLangOpts() *LanguageOpts {
 		if err != nil {
 			return "", err
 		}
-		return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(string(b), "}", ",}"), "[", "{"), "]", ",}"), nil
+		return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(string(b), "}", ",}"), "[", "{"), "]", ",}"), "{,}", "{}"), nil
 	}
 
 	opts.BaseImportFunc = func(tgt string) string {
diff --git a/generator/language_test.go b/generator/language_test.go
index <HASH>..<HASH> 100644
--- a/generator/language_test.go
+++ b/generator/language_test.go
@@ -74,6 +74,11 @@ func TestGolang_SliceInitializer(t *testing.T) {
 		B func() string
 	}{A: "good", B: func() string { return "" }})
 	require.Error(t, err)
+
+	a3 := []interface{}{}
+	res, err = goSliceInitializer(a3)
+	assert.NoError(t, err)
+	assert.Equal(t, `{}`, res)
 }
 
 func TestGolangInit(t *testing.T) {
generator: fix initialization of empty arrays