diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e3d8d34..03d8e17 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,10 +14,10 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: ^1.19 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -44,3 +44,7 @@ jobs: # skip-build-cache: true - name: testing run: go test -shuffle on ./... + - name: install govulncheck + run: go install golang.org/x/vuln/cmd/govulncheck@latest + - name: running govulncheck + run: govulncheck ./... diff --git a/.github/workflows/vulns.yml b/.github/workflows/vulns.yml index af80b13..2c51e0e 100644 --- a/.github/workflows/vulns.yml +++ b/.github/workflows/vulns.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version-file: 'go.mod' - name: install depm run: go install github.com/goark/depm@latest - name: WriteGoList diff --git a/README.md b/README.md index fabe740..7f93e12 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ const ( ## 簡単な使い方 ```go -start, _ := koyomi.DateFrom("2019-05-01") -end := koyomi.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, koyomi.JST)) +start, _ := value.DateFrom("2019-05-01") +end := value.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, koyomi.JST)) k, err := koyomi.NewSource( koyomi.WithCalendarID(koyomi.Holiday, koyomi.SolarTerm), koyomi.WithStartDate(start), @@ -83,7 +83,7 @@ import ( "strconv" "time" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func main() { @@ -106,7 +106,7 @@ func main() { } tm = time.Date(args[0], time.Month(args[1]), args[2], 0, 0, 0, 0, time.Local) } - te := koyomi.NewDate(tm) + te := value.NewDate(tm) n, y := te.YearEraString() if len(n) == 0 { fmt.Fprintln(os.Stderr, "正しい年月日を指定してください") @@ -141,7 +141,7 @@ import ( "strconv" "time" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func main() { @@ -162,7 +162,7 @@ func main() { } args[i] = num } - te := koyomi.NewDateEra(koyomi.EraName(name), args[0], time.Month(args[1]), args[2], 0, 0, 0, 0, time.Local) + te := value.NewDateEra(value.EraName(name), args[0], time.Month(args[1]), args[2]) fmt.Println(te.Format("西暦2006年1月2日")) } ``` @@ -190,7 +190,7 @@ import ( "fmt" "os" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" "github.com/goark/koyomi/zodiac" ) @@ -202,7 +202,7 @@ func main() { return } for _, s := range args { - t, err := koyomi.DateFrom(s) + t, err := value.DateFrom(s) if err != nil { fmt.Fprintln(os.Stderr, err) continue @@ -236,8 +236,8 @@ import ( "fmt" "os" - "github.com/goark/koyomi" "github.com/goark/koyomi/jdn" + "github.com/goark/koyomi/value" ) func main() { @@ -248,7 +248,7 @@ func main() { return } for _, s := range args { - t, err := koyomi.DateFrom(s) + t, err := value.DateFrom(s) if err != nil { fmt.Fprintln(os.Stderr, err) continue diff --git a/Taskfile.yml b/Taskfile.yml index b59a3f6..59dcca6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -3,7 +3,7 @@ version: '3' tasks: default: cmds: - - task: clean + - task: prepare - task: test - task: nancy - task: graph @@ -13,7 +13,8 @@ tasks: cmds: - go mod verify - go test -shuffle on ./... - - docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run --enable gosec --timeout 3m0s ./... + - govulncheck ./... + - docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.2 golangci-lint run --enable gosec --timeout 3m0s ./... sources: - ./go.mod - '**/*.go' @@ -26,13 +27,15 @@ tasks: - ./go.mod - '**/*.go' + prepare: + - go mod tidy -v -go=1.20 + clean: desc: Initialize module and build cache, and remake go.sum file. cmds: - rm -f ./go.sum - go clean -cache - go clean -modcache - - go mod tidy -v -go=1.19 graph: desc: Make grapth of dependency modules. diff --git a/dependency.png b/dependency.png index 356eef0..b3a17d8 100644 Binary files a/dependency.png and b/dependency.png differ diff --git a/events.go b/events.go index 9373c8e..82f305f 100644 --- a/events.go +++ b/events.go @@ -8,25 +8,26 @@ import ( "strconv" "github.com/goark/errs" + "github.com/goark/koyomi/value" ) -//Event is koyomi event data +// Event is koyomi event data type Event struct { - Date DateJp + Date value.DateJp Title string } -//Koyomi is array of Event +// Koyomi is array of Event type Koyomi struct { events []Event } -//newKoyomi createw Koyomi instance +// newKoyomi createw Koyomi instance func newKoyomi() *Koyomi { return &Koyomi{events: make([]Event, 0)} } -//Events returns event array +// Events returns event array func (k *Koyomi) Events() []Event { if k == nil { return []Event{} @@ -34,7 +35,7 @@ func (k *Koyomi) Events() []Event { return k.events } -//SortByDate sorts event data by date +// SortByDate sorts event data by date func (k *Koyomi) SortByDate() { if k == nil || len(k.events) <= 1 { return @@ -44,7 +45,7 @@ func (k *Koyomi) SortByDate() { }) } -//Add adds other Kyomoi instance +// Add adds other Kyomoi instance func (k *Koyomi) Add(kk *Koyomi) { if kk == nil { return diff --git a/example_test.go b/example_test.go index d13d49e..2da12fb 100644 --- a/example_test.go +++ b/example_test.go @@ -8,11 +8,12 @@ import ( "time" "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func ExampleKoyomi() { - start, _ := koyomi.DateFrom("2019-05-01") - end := koyomi.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, koyomi.JST)) + start, _ := value.DateFrom("2019-05-01") + end := value.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, value.JST)) k, err := koyomi.NewSource( koyomi.WithCalendarID(koyomi.Holiday, koyomi.SolarTerm), koyomi.WithStartDate(start), @@ -43,7 +44,7 @@ func ExampleKoyomi() { //"2019-05-21","小満" } -/* Copyright 2020 Spiegel +/* Copyright 2020-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/go.mod b/go.mod index d5eb1cd..ae78a18 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/goark/koyomi -go 1.19 +go 1.20 require ( - github.com/goark/errs v1.1.0 + github.com/goark/errs v1.2.2 github.com/spiegel-im-spiegel/ics-golang v0.1.0 ) diff --git a/go.sum b/go.sum index 8644f0b..59c23d5 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/goark/errs v1.1.0 h1:FKnyw4LVyRADIjM8Nj0Up6r0/y5cfADvZAd1E+tthXE= -github.com/goark/errs v1.1.0/go.mod h1:TtaPEoadm2mzqzfXdkkfpN2xuniCFm2q4JH+c1qzaqw= +github.com/goark/errs v1.2.2 h1:UrMZZJL0WaOzaO+ErSV+nz/k/+bmW2wUiFe5V7pUeEo= +github.com/goark/errs v1.2.2/go.mod h1:ZsQucxaDFVfSB8I99j4bxkDRfNOrlKINwg72QMuRWKw= github.com/goark/fetch v0.3.0 h1:2m32EGOLBi99RzI5urFfmv5++CMqfenVw7NH8z/lbX8= github.com/goark/fetch v0.3.0/go.mod h1:sqDdPbbHeIjDVeHrgvzhHpkUr8X9pVC9DgJoVwU02x0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/sample/sample0.go b/sample/sample0.go index 5a2d645..f5cc69d 100644 --- a/sample/sample0.go +++ b/sample/sample0.go @@ -10,11 +10,12 @@ import ( "time" "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func main() { - start, _ := koyomi.DateFrom("2019-05-01") - end := koyomi.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, koyomi.JST)) + start, _ := value.DateFrom("2019-05-01") + end := value.NewDate(time.Date(2019, time.May, 31, 0, 0, 0, 0, value.JST)) k, err := koyomi.NewSource( koyomi.WithCalendarID(koyomi.Holiday, koyomi.SolarTerm), koyomi.WithStartDate(start), @@ -31,7 +32,7 @@ func main() { io.Copy(os.Stdout, bytes.NewReader(csv)) } -/* Copyright 2022 Spiegel +/* Copyright 2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/sample/sample1.go b/sample/sample1.go index 6592d1b..3b4b405 100644 --- a/sample/sample1.go +++ b/sample/sample1.go @@ -10,7 +10,7 @@ import ( "strconv" "time" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func main() { @@ -33,7 +33,7 @@ func main() { } tm = time.Date(args[0], time.Month(args[1]), args[2], 0, 0, 0, 0, time.Local) } - te := koyomi.NewDate(tm) + te := value.NewDate(tm) n, y := te.YearEraString() if len(n) == 0 { fmt.Fprintln(os.Stderr, "正しい年月日を指定してください") @@ -42,7 +42,7 @@ func main() { fmt.Printf("%s%s%d月%d日\n", n, y, te.Month(), te.Day()) } -/* Copyright 2019-2022 Spiegel +/* Copyright 2019-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/sample/sample2.go b/sample/sample2.go index 786e5ba..012c41f 100644 --- a/sample/sample2.go +++ b/sample/sample2.go @@ -10,7 +10,7 @@ import ( "strconv" "time" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" ) func main() { @@ -31,11 +31,11 @@ func main() { } args[i] = num } - te := koyomi.NewDateEra(koyomi.EraName(name), args[0], time.Month(args[1]), args[2]) + te := value.NewDateEra(value.EraName(name), args[0], time.Month(args[1]), args[2]) fmt.Println(te.Format("西暦2006年1月2日")) } -/* Copyright 2019-2022 Spiegel +/* Copyright 2019-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/sample/sample3.go b/sample/sample3.go index f40039b..d1a057f 100644 --- a/sample/sample3.go +++ b/sample/sample3.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" "github.com/goark/koyomi/zodiac" ) @@ -20,7 +20,7 @@ func main() { return } for _, s := range args { - t, err := koyomi.DateFrom(s) + t, err := value.DateFrom(s) if err != nil { fmt.Fprintln(os.Stderr, err) continue diff --git a/sample/sample4.go b/sample/sample4.go index 115015e..0568931 100644 --- a/sample/sample4.go +++ b/sample/sample4.go @@ -8,8 +8,8 @@ import ( "fmt" "os" - "github.com/goark/koyomi" "github.com/goark/koyomi/jdn" + "github.com/goark/koyomi/value" ) func main() { @@ -20,7 +20,7 @@ func main() { return } for _, s := range args { - t, err := koyomi.DateFrom(s) + t, err := value.DateFrom(s) if err != nil { fmt.Fprintln(os.Stderr, err) continue diff --git a/source.go b/source.go index 95376eb..c8a3a2d 100644 --- a/source.go +++ b/source.go @@ -2,14 +2,15 @@ package koyomi import ( "github.com/goark/errs" + "github.com/goark/koyomi/value" ics "github.com/spiegel-im-spiegel/ics-golang" ) // Source is information of data source for koyomi type Source struct { cids []CalendarID - start DateJp - end DateJp + start value.DateJp + end value.DateJp tempDir string //temporary directory for github.com/spiegel-im-spiegel/ics-golang package } @@ -35,14 +36,14 @@ func WithCalendarID(cid ...CalendarID) optFunc { } // WithStartDate returns function for setting Reader -func WithStartDate(start DateJp) optFunc { +func WithStartDate(start value.DateJp) optFunc { return func(s *Source) { s.start = start } } // WithEndDate returns function for setting Reader -func WithEndDate(end DateJp) optFunc { +func WithEndDate(end value.DateJp) optFunc { return func(s *Source) { s.end = end } @@ -78,7 +79,7 @@ func (s *Source) Get() (*Koyomi, error) { return k, nil } -func getFrom(cid CalendarID, start, end DateJp) ([]Event, error) { +func getFrom(cid CalendarID, start, end value.DateJp) ([]Event, error) { url := cid.URL() if len(url) == 0 { return nil, errs.Wrap(ErrNoData, errs.WithContext("cid", int(cid)), errs.WithContext("start", start.String()), errs.WithContext("end", end.String())) @@ -95,7 +96,7 @@ func getFrom(cid CalendarID, start, end DateJp) ([]Event, error) { kevts := []Event{} for _, calendar := range calendars { for _, evt := range calendar.GetEvents() { - e := Event{Date: NewDate(evt.GetStart()), Title: evt.GetSummary()} + e := Event{Date: value.NewDate(evt.GetStart()), Title: evt.GetSummary()} if boundaryIn(e, start, end) { kevts = append(kevts, e) } @@ -104,7 +105,7 @@ func getFrom(cid CalendarID, start, end DateJp) ([]Event, error) { return kevts, nil } -func boundaryIn(e Event, start, end DateJp) bool { +func boundaryIn(e Event, start, end value.DateJp) bool { if e.Date.IsZero() { return false } @@ -117,7 +118,7 @@ func boundaryIn(e Event, start, end DateJp) bool { return true } -/* Copyright 2020-2022 Spiegel +/* Copyright 2020-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/date.go b/value/date.go similarity index 80% rename from date.go rename to value/date.go index c65ce7d..8d425bf 100644 --- a/date.go +++ b/value/date.go @@ -1,4 +1,4 @@ -package koyomi +package value import ( "strconv" @@ -13,12 +13,12 @@ var ( JST = time.FixedZone("JST", int(jstoffset)) // Japan standard Time ) -//DateJp is wrapper class of time.Time +// DateJp is wrapper class of time.Time type DateJp struct { time.Time } -//NewDate returns DateJp instance +// NewDate returns DateJp instance func NewDate(tm time.Time) DateJp { if tm.IsZero() { return DateJp{tm} @@ -34,7 +34,7 @@ var timeTemplate = []string{ time.RFC3339, } -//DateFrom returns DateJp instance from date string +// DateFrom returns DateJp instance from date string func DateFrom(s string) (DateJp, error) { if len(s) == 0 || strings.EqualFold(s, "null") { return NewDate(time.Time{}), nil @@ -50,7 +50,7 @@ func DateFrom(s string) (DateJp, error) { return NewDate(time.Time{}), lastErr } -//UnmarshalJSON returns result of Unmarshal for json.Unmarshal() +// UnmarshalJSON returns result of Unmarshal for json.Unmarshal() func (t *DateJp) UnmarshalJSON(b []byte) error { s, err := strconv.Unquote(string(b)) if err != nil { @@ -64,7 +64,7 @@ func (t *DateJp) UnmarshalJSON(b []byte) error { return nil } -//MarshalJSON returns time string with RFC3339 format +// MarshalJSON returns time string with RFC3339 format func (t *DateJp) MarshalJSON() ([]byte, error) { if t == nil { return []byte("\"\""), nil @@ -79,32 +79,32 @@ func (t DateJp) String() string { return t.Format("2006-01-02") } -//Equal reports whether t and dt represent the same time instant. +// Equal reports whether t and dt represent the same time instant. func (t DateJp) Equal(dt DateJp) bool { return t.Time.Year() == dt.Time.Year() && t.Time.Month() == dt.Time.Month() && t.Time.Day() == dt.Time.Day() } -//Before reports whether the DateJp instant t is before dt. +// Before reports whether the DateJp instant t is before dt. func (t DateJp) Before(dt DateJp) bool { return !t.Equal(dt) && t.Time.Before(dt.Time) } -//After reports whether the DateJp instant t is after dt. +// After reports whether the DateJp instant t is after dt. func (t DateJp) After(dt DateJp) bool { return !t.Equal(dt) && t.Time.After(dt.Time) } -//AddDate method adds years/months/days and returns new Date instance. +// AddDate method adds years/months/days and returns new Date instance. func (t DateJp) AddDate(years int, months int, days int) DateJp { return NewDate(t.Time.AddDate(years, months, days)) } -//AddDay method adds n days and returns new Date instance. +// AddDay method adds n days and returns new Date instance. func (t DateJp) AddDay(days int) DateJp { return t.AddDate(0, 0, days) } -/* Copyright 2020-2022 Spiegel +/* Copyright 2020-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/date_test.go b/value/date_test.go similarity index 98% rename from date_test.go rename to value/date_test.go index 6ad5d42..50f16a7 100644 --- a/date_test.go +++ b/value/date_test.go @@ -1,4 +1,4 @@ -package koyomi +package value import ( "encoding/json" @@ -78,7 +78,7 @@ func TestEqual(t *testing.T) { } } -/* Copyright 2020-2022 Spiegel +/* Copyright 2020-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/era.go b/value/era.go similarity index 75% rename from era.go rename to value/era.go index db1e6e2..850d329 100644 --- a/era.go +++ b/value/era.go @@ -1,11 +1,11 @@ -package koyomi +package value import ( "fmt" "time" ) -//eraName は元号名を表す内部型です。 +// eraName は元号名を表す内部型です。 type eraName int const ( @@ -26,8 +26,8 @@ var eraString = map[eraName]string{ Reiwa: "令和", } -//koyomi.EraName() 関数は元号の文字列から元号名 eraName を取得します。 -//該当する元号名がない場合は era.Unknown を返します。 +// value.EraName() 関数は元号の文字列から元号名 eraName を取得します。 +// 該当する元号名がない場合は era.Unknown を返します。 func EraName(s string) eraName { for k, v := range eraString { if v == s { @@ -55,8 +55,8 @@ var ( eraSorted = []eraName{Reiwa, Heisei, Showa, Taisho, Meiji} //ソートされた元号の配列(降順) ) -//koyomi.NewDateEra() 関数は 元号・年・月・日・時・分・秒・タイムゾーン を指定して koyomi.DateJp 型のインスタンスを返します。 -//起点が定義されない元号を指定した場合は西暦として処理します。 +// value.NewDateEra() 関数は 元号・年・月・日・時・分・秒・タイムゾーン を指定して value.DateJp 型のインスタンスを返します。 +// 起点が定義されない元号を指定した場合は西暦として処理します。 func NewDateEra(en eraName, year int, month time.Month, day int) DateJp { ofset := 0 if dt, ok := eraTrigger[en]; ok { @@ -65,8 +65,8 @@ func NewDateEra(en eraName, year int, month time.Month, day int) DateJp { return NewDate(time.Date(year+ofset, month, day, 0, 0, 0, 0, JST)) } -//koyomi.DateJp.Era() メソッドは元号名 koyomi.eraName のインスタンスを返します。 -//元号が不明の場合は era.Unknown を返します。 +// value.DateJp.Era() メソッドは元号名 value.eraName のインスタンスを返します。 +// 元号が不明の場合は era.Unknown を返します。 func (t DateJp) Era() eraName { for _, es := range eraSorted { if !t.Before(eraTrigger[es]) { @@ -77,8 +77,8 @@ func (t DateJp) Era() eraName { } -//koyomi.DateJp.YearEra() メソッドは元号付きの年の値を返します。 -//元号が不明の場合は (era.Unknown, 0) を返します。 +// value.DateJp.YearEra() メソッドは元号付きの年の値を返します。 +// 元号が不明の場合は (era.Unknown, 0) を返します。 func (t DateJp) YearEra() (eraName, int) { era := t.Era() if era == EraUnknown { @@ -91,8 +91,8 @@ func (t DateJp) YearEra() (eraName, int) { return era, year } -//koyomi.DateJp.YearEraString() メソッドは元号付きの年の値を文字列で返します。 -//元号が不明の場合は空文字列を返します。 +// value.DateJp.YearEraString() メソッドは元号付きの年の値を文字列で返します。 +// 元号が不明の場合は空文字列を返します。 func (t DateJp) YearEraString() (string, string) { era, year := t.YearEra() if era == EraUnknown || year < 1 { @@ -104,7 +104,7 @@ func (t DateJp) YearEraString() (string, string) { return era.String(), fmt.Sprintf("%d年", year) } -/* Copyright 2019-2022 Spiegel +/* Copyright 2019-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/era_test.go b/value/era_test.go similarity index 98% rename from era_test.go rename to value/era_test.go index 836effe..ee5a50b 100644 --- a/era_test.go +++ b/value/era_test.go @@ -1,4 +1,4 @@ -package koyomi +package value import ( "testing" @@ -102,7 +102,7 @@ func TestEraToDate(t *testing.T) { } } -/* Copyright 2019-2022 Spiegel +/* Copyright 2019-2023 Spiegel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/zodiac/zodiac.go b/zodiac/zodiac.go index 58b8fdb..a2d4c6d 100644 --- a/zodiac/zodiac.go +++ b/zodiac/zodiac.go @@ -1,8 +1,8 @@ package zodiac import ( - "github.com/goark/koyomi" "github.com/goark/koyomi/jdn" + "github.com/goark/koyomi/value" ) type Kan10 uint @@ -70,7 +70,7 @@ var ( ) // ZodiacDayNumber function returns japanese zodiac day number. -func ZodiacDayNumber(t koyomi.DateJp) (Kan10, Shi12) { +func ZodiacDayNumber(t value.DateJp) (Kan10, Shi12) { n := jdn.GetJDN(t.Time) + 50 k := n % int64(KanMax) if k < 0 { diff --git a/zodiac/zodiac_test.go b/zodiac/zodiac_test.go index bd04bde..07cf389 100644 --- a/zodiac/zodiac_test.go +++ b/zodiac/zodiac_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/goark/koyomi" + "github.com/goark/koyomi/value" "github.com/goark/koyomi/zodiac" ) @@ -74,18 +74,18 @@ func TestShi12(t *testing.T) { func TestZodiac(t *testing.T) { testCases := []struct { - t koyomi.DateJp + t value.DateJp kanYear zodiac.Kan10 shiYear zodiac.Shi12 kanDay zodiac.Kan10 shiDay zodiac.Shi12 }{ - {t: koyomi.NewDate(time.Date(1983, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Mizunoto, shiYear: zodiac.Boar, kanDay: zodiac.Tsutinoto, shiDay: zodiac.Ox}, - {t: koyomi.NewDate(time.Date(1984, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Kinoe, shiYear: zodiac.Rat, kanDay: zodiac.Kinoe, shiDay: zodiac.Horse}, - {t: koyomi.NewDate(time.Date(1985, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Kinoto, shiYear: zodiac.Ox, kanDay: zodiac.Kanoe, shiDay: zodiac.Rat}, - {t: koyomi.NewDate(time.Date(2000, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Kanoe, shiYear: zodiac.Dragon, kanDay: zodiac.Tsutinoe, shiDay: zodiac.Horse}, - {t: koyomi.NewDate(time.Date(2001, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Kanoto, shiYear: zodiac.Snake, kanDay: zodiac.Kinoe, shiDay: zodiac.Rat}, - {t: koyomi.NewDate(time.Date(2002, time.January, 1, 0, 0, 0, 0, koyomi.JST)), kanYear: zodiac.Mizunoe, shiYear: zodiac.Horse, kanDay: zodiac.Tsutinoto, shiDay: zodiac.Snake}, + {t: value.NewDate(time.Date(1983, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Mizunoto, shiYear: zodiac.Boar, kanDay: zodiac.Tsutinoto, shiDay: zodiac.Ox}, + {t: value.NewDate(time.Date(1984, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Kinoe, shiYear: zodiac.Rat, kanDay: zodiac.Kinoe, shiDay: zodiac.Horse}, + {t: value.NewDate(time.Date(1985, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Kinoto, shiYear: zodiac.Ox, kanDay: zodiac.Kanoe, shiDay: zodiac.Rat}, + {t: value.NewDate(time.Date(2000, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Kanoe, shiYear: zodiac.Dragon, kanDay: zodiac.Tsutinoe, shiDay: zodiac.Horse}, + {t: value.NewDate(time.Date(2001, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Kanoto, shiYear: zodiac.Snake, kanDay: zodiac.Kinoe, shiDay: zodiac.Rat}, + {t: value.NewDate(time.Date(2002, time.January, 1, 0, 0, 0, 0, value.JST)), kanYear: zodiac.Mizunoe, shiYear: zodiac.Horse, kanDay: zodiac.Tsutinoto, shiDay: zodiac.Snake}, } for _, tc := range testCases {