1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-26 04:26:07 +08:00

Remove unused TimeParts struct (#10708)

This commit is contained in:
Andrew Gillis
2025-02-11 12:35:19 -10:00
committed by GitHub
parent e77a484aa8
commit d137d7a4ad

View File

@ -8,7 +8,6 @@ import (
gopath "path"
"strconv"
"strings"
"time"
"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/commands/cmdenv"
@ -27,23 +26,6 @@ import (
// ErrDepthLimitExceeded indicates that the max depth has been exceeded.
var ErrDepthLimitExceeded = errors.New("depth limit exceeded")
type TimeParts struct {
t *time.Time
}
func (t TimeParts) MarshalJSON() ([]byte, error) {
return t.t.MarshalJSON()
}
// UnmarshalJSON implements the json.Unmarshaler interface.
// The time is expected to be a quoted string in RFC 3339 format.
func (t *TimeParts) UnmarshalJSON(data []byte) (err error) {
// Fractional seconds are handled implicitly by Parse.
tt, err := time.Parse("\"2006-01-02T15:04:05Z\"", string(data))
*t = TimeParts{&tt}
return
}
type AddEvent struct {
Name string
Hash string `json:",omitempty"`