Skip to content

Commit

Permalink
ci: check error
Browse files Browse the repository at this point in the history
  • Loading branch information
hui.wang committed Apr 15, 2022
1 parent c6721b4 commit 6e5e46a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/bugs/bugs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ func TestBug_6(t *testing.T) {
}

func TestBug_7(t *testing.T) {
type Server2 struct {
Timeouts map[string]time.Duration
}
type Server struct {
Timeouts map[string]time.Duration `xconf:"timeouts"`
privateServer Server2
}
ss := &Server{Timeouts: map[string]time.Duration{"read": time.Second}}
ss.privateServer.Timeouts = map[string]time.Duration{"read": time.Second}
xconf.SaveVarToWriterAsYAML(ss, os.Stderr)
Convey("should skip private field", t, func(c C) {
type Server2 struct {
Timeouts map[string]time.Duration
}
type Server struct {
Timeouts map[string]time.Duration `xconf:"timeouts"`
privateServer Server2
}
ss := &Server{Timeouts: map[string]time.Duration{"read": time.Second}}
ss.privateServer.Timeouts = map[string]time.Duration{"read": time.Second}
So(xconf.SaveVarToWriterAsYAML(ss, os.Stderr), ShouldBeNil)
})
}

0 comments on commit 6e5e46a

Please sign in to comment.