all repos — searchix @ b70a8644a90c22ed0fffef878f4061c6340732df

Search engine for NixOS, nix-darwin, home-manager and NUR users

style: address linter complaints

Alan Pearce
commit

b70a8644a90c22ed0fffef878f4061c6340732df

parent

33e4a7d74354eacfcb43f1d1a15a354035724268

3 files changed, 8 insertions(+), 8 deletions(-)

changed files
M internal/config/config.gointernal/config/config.go
@@ -21,7 +21,7 @@ *url.URL
} func (u *URL) MarshalText() ([]byte, error) { - return []byte(u.URL.String()), nil + return []byte(u.String()), nil } func (u *URL) UnmarshalText(text []byte) (err error) {
@@ -49,7 +49,7 @@ time.Duration
} func (d *Duration) MarshalText() ([]byte, error) { - return []byte(d.Duration.String()), nil + return []byte(d.String()), nil } func (d *Duration) UnmarshalText(text []byte) (err error) {
M internal/index/index_meta.gointernal/index/index_meta.go
@@ -104,7 +104,7 @@ return nil
} func (i *Meta) GetSourceMeta(source string) *SourceMeta { - sourceMeta := i.data.Sources[source] + sourceMeta := i.Sources[source] if sourceMeta == nil { return &SourceMeta{} }
@@ -113,15 +113,15 @@ return sourceMeta
} func (i *Meta) SetSourceMeta(source string, meta *SourceMeta) { - if i.data.Sources == nil { - i.data.Sources = make(map[string]*SourceMeta) + if i.Sources == nil { + i.Sources = make(map[string]*SourceMeta) } - i.data.Sources[source] = meta + i.Sources[source] = meta } func (i *Meta) LastUpdated() time.Time { var last time.Time - for _, sourceMeta := range i.data.Sources { + for _, sourceMeta := range i.Sources { if sourceMeta.Updated.After(last) { last = sourceMeta.Updated }
M internal/server/mux.gointernal/server/mux.go
@@ -102,7 +102,7 @@
return } - var pageSize int = search.DefaultPageSize + var pageSize = search.DefaultPageSize var pageNumber = 1 if pg := r.URL.Query().Get("page"); pg != "" { pageNumber, err = strconv.Atoi(pg)