From 556842d615ef0b339d818b4deb891c722f1e11b5 Mon Sep 17 00:00:00 2001 From: Spiegel Date: Sat, 25 Feb 2023 10:25:59 +0900 Subject: [PATCH 1/2] Move koyomi.DateJp to koyomi/value.DateJp --- .github/workflows/lint.yml | 8 ++++++-- .github/workflows/vulns.yml | 2 +- README.md | 20 ++++++++++---------- Taskfile.yml | 9 ++++++--- events.go | 15 ++++++++------- example_test.go | 7 ++++--- sample/sample0.go | 7 ++++--- sample/sample1.go | 6 +++--- sample/sample2.go | 6 +++--- sample/sample3.go | 4 ++-- sample/sample4.go | 4 ++-- source.go | 17 +++++++++-------- date.go => value/date.go | 24 ++++++++++++------------ date_test.go => value/date_test.go | 4 ++-- era.go => value/era.go | 26 +++++++++++++------------- era_test.go => value/era_test.go | 4 ++-- zodiac/zodiac.go | 4 ++-- zodiac/zodiac_test.go | 16 ++++++++-------- 18 files changed, 97 insertions(+), 86 deletions(-) rename date.go => value/date.go (80%) rename date_test.go => value/date_test.go (98%) rename era.go => value/era.go (75%) rename era_test.go => value/era_test.go (98%) 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/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/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 { From 35bddb50241810e9cfd7f37b61cbf87feedc0066 Mon Sep 17 00:00:00 2001 From: Spiegel Date: Sat, 25 Feb 2023 10:32:29 +0900 Subject: [PATCH 2/2] Update go.mod --- dependency.png | Bin 59819 -> 59771 bytes go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dependency.png b/dependency.png index 356eef085afff2afcdcaf97b92d8082da3742e58..b3a17d82a875188018ac33dcf4f766124d679d87 100644 GIT binary patch delta 6088 zcmYLN2Q*gy8-Ha>R`$%x&mKiaWMq?!lI)B^b|srz_8y5yGE1V2>})CFhu2==C1sDY z=l^+ie&>IWqt2;&zxO`R=lP7Mpbvk)7r%H3gYdok6M(<-F_WaUIBMlVMBoF4Bm!%J z0vb9Afpf|B8sY=o!-{#aiHx#8M|0og^4OANQnWQgtexWT<C(}W+c1Y9-}A?I3BSZY&b&Ik>fObjvhKGnx9Zrxg>4Djv@S6!!q}59 z(vl$|6XWA%8EI*bMz>5%-mNYyh&dg9Uk%6`THM_8-`|>dc5>R74A^%r8b3@QdUGvp zBZ@&(a&LcU@%Hh%=UT6W+QsAjr>CbkDk>`Wy1H~)wn9UR{C#}(_2<@d`=5B1E=o%^p^pL-Rscdx3tnkku! ziwh4mGBSei!X+=y-YvJydT?+MJ=pN4OSZVOQr+2ExU{si_-+Tik&zK&h3iNuVR|}} zzVkE96*bOO(DL;wG0O7Zy@=gEzgQ+b-Q5|>4_hb|rrHv?yk=sgd}ilYO~^0CX>d1h z%=h7;mY0{S9xc)*3mKnE*9q(Gy`EzuVpc_khldwBTmR;HOiWCxU{P&gbTl~uG4b}U z@x*FvZ*On0&!&Tcp`lW~0sJ%%4KW}BNn}zk4hLYqYOLC1~6+P^=p3N|*Khe#dk1q*^+8Eg#H3P0h{{MyQmi%b@uab+4h?%*0i5phwrL3pUoQ4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