Remove unused TimeParts struct (#10708)
Andrew Gillis committed
Feb 11, 2025 at 12:35 UTC
d137d7a4adedea064642baea3f441653af88a982
1 file changed
-18
core/commands/add.go
-18
@@ -8,7 +8,6 @@ import (
8
gopath "path"
9
"strconv"
10
"strings"
11
- "time"
11
12
"github.com/ipfs/kubo/config"
13
"github.com/ipfs/kubo/core/commands/cmdenv"
@@ -27,23 +26,6 @@ import (
26
// ErrDepthLimitExceeded indicates that the max depth has been exceeded.
27
var ErrDepthLimitExceeded = errors.New("depth limit exceeded")
28
30
-type TimeParts struct {
31
- t *time.Time
32
-}
33
-
34
-func (t TimeParts) MarshalJSON() ([]byte, error) {
35
- return t.t.MarshalJSON()
36
-}
37
-
38
-// UnmarshalJSON implements the json.Unmarshaler interface.
39
-// The time is expected to be a quoted string in RFC 3339 format.
40
-func (t *TimeParts) UnmarshalJSON(data []byte) (err error) {
41
- // Fractional seconds are handled implicitly by Parse.
42
- tt, err := time.Parse("\"2006-01-02T15:04:05Z\"", string(data))
43
- *t = TimeParts{&tt}
44
- return
45
-}
46
-
29
type AddEvent struct {
30
Name string
31
Hash string `json:",omitempty"`