Skip to content

Commit

Permalink
Remove unused TimeParts struct (#10708)
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Feb 11, 2025
1 parent e77a484 commit d137d7a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
gopath "path"
"strconv"
"strings"
"time"

"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/commands/cmdenv"
Expand All @@ -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"`
Expand Down

0 comments on commit d137d7a

Please sign in to comment.