mirror of
https://github.com/restic/restic.git
synced 2025-12-08 06:09:56 +00:00
Upadte vendored dependencies
This commit is contained in:
parent
315b7f282f
commit
8d37b723ca
380 changed files with 136541 additions and 78532 deletions
23
vendor/github.com/go-ini/ini/struct_test.go
generated
vendored
23
vendor/github.com/go-ini/ini/struct_test.go
generated
vendored
|
|
@ -244,9 +244,23 @@ age=a30`))
|
|||
So(cfg.Section("").StrictMapTo(s), ShouldNotBeNil)
|
||||
})
|
||||
|
||||
Convey("Map slice in strict mode", t, func() {
|
||||
cfg, err := Load([]byte(`
|
||||
names=alice, bruce`))
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
type Strict struct {
|
||||
Names []string `ini:"names"`
|
||||
}
|
||||
s := new(Strict)
|
||||
|
||||
So(cfg.Section("").StrictMapTo(s), ShouldBeNil)
|
||||
So(fmt.Sprint(s.Names), ShouldEqual, "[alice bruce]")
|
||||
})
|
||||
|
||||
Convey("Reflect from struct", t, func() {
|
||||
type Embeded struct {
|
||||
Dates []time.Time `delim:"|"`
|
||||
Dates []time.Time `delim:"|" comment:"Time data"`
|
||||
Places []string
|
||||
Years []int
|
||||
Numbers []int64
|
||||
|
|
@ -258,12 +272,12 @@ age=a30`))
|
|||
type Author struct {
|
||||
Name string `ini:"NAME"`
|
||||
Male bool
|
||||
Age int
|
||||
Age int `comment:"Author's age"`
|
||||
Height uint
|
||||
GPA float64
|
||||
Date time.Time
|
||||
NeverMind string `ini:"-"`
|
||||
*Embeded `ini:"infos"`
|
||||
*Embeded `ini:"infos" comment:"Embeded section"`
|
||||
}
|
||||
|
||||
t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z")
|
||||
|
|
@ -287,12 +301,15 @@ age=a30`))
|
|||
So(err, ShouldBeNil)
|
||||
So(buf.String(), ShouldEqual, `NAME = Unknwon
|
||||
Male = true
|
||||
; Author's age
|
||||
Age = 21
|
||||
Height = 100
|
||||
GPA = 2.8
|
||||
Date = 1993-10-07T20:17:05Z
|
||||
|
||||
; Embeded section
|
||||
[infos]
|
||||
; Time data
|
||||
Dates = 1993-10-07T20:17:05Z|1993-10-07T20:17:05Z
|
||||
Places = HangZhou,Boston
|
||||
Years = 1993,1994
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue