Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <18012015693@163.com>
  • Loading branch information
He1pa committed Jan 6, 2025
1 parent dc39dbf commit 56025df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/3rdparty/toml/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) {
}

func (enc *Encoder) eTable(key Key, rv reflect.Value) {
inTable := enc.inTable
enc.inTable = true
if len(key) == 1 {
// Output an extra newline between top-level tables.
Expand All @@ -407,7 +406,7 @@ func (enc *Encoder) eTable(key Key, rv reflect.Value) {
enc.newline()
}
enc.eMapOrStruct(key, rv, false)
enc.inTable = inTable
enc.inTable = false
}

func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value, inline bool) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/tools/gen/gentoml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ c_key = "value3"
} else if err == nil && tt.expectErr == nil {
if got := string(tomlData); got != tt.expectedTOML {
t.Errorf("expected:\n%s\ngot:\n%s", tt.expectedTOML, got)
} else {
t.Fatalf("expected error: %v, got: %v", tt.expectErr, err)
}
} else {
t.Fatalf("expected error: %v, got: %v", tt.expectErr, err)
}

})
Expand Down

0 comments on commit 56025df

Please sign in to comment.