ci: run go vet #503

closed
opened by winter.bsky.social targeting master from push-zvtqtworuppk
Changed files
+22 -18
.tangled
workflows
appview
pages
reporesolver
spindles
state
+15 -15
appview/pages/funcmap.go
···
"relTimeFmt": humanize.Time,
"shortRelTimeFmt": func(t time.Time) string {
return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{
-
{time.Second, "now", time.Second},
-
{2 * time.Second, "1s %s", 1},
-
{time.Minute, "%ds %s", time.Second},
-
{2 * time.Minute, "1min %s", 1},
-
{time.Hour, "%dmin %s", time.Minute},
-
{2 * time.Hour, "1hr %s", 1},
-
{humanize.Day, "%dhrs %s", time.Hour},
-
{2 * humanize.Day, "1d %s", 1},
-
{20 * humanize.Day, "%dd %s", humanize.Day},
-
{8 * humanize.Week, "%dw %s", humanize.Week},
-
{humanize.Year, "%dmo %s", humanize.Month},
-
{18 * humanize.Month, "1y %s", 1},
-
{2 * humanize.Year, "2y %s", 1},
-
{humanize.LongTime, "%dy %s", humanize.Year},
-
{math.MaxInt64, "a long while %s", 1},
})
},
"longTimeFmt": func(t time.Time) string {
···
"relTimeFmt": humanize.Time,
"shortRelTimeFmt": func(t time.Time) string {
return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{
+
{D: time.Second, Format: "now", DivBy: time.Second},
+
{D: 2 * time.Second, Format: "1s %s", DivBy: 1},
+
{D: time.Minute, Format: "%ds %s", DivBy: time.Second},
+
{D: 2 * time.Minute, Format: "1min %s", DivBy: 1},
+
{D: time.Hour, Format: "%dmin %s", DivBy: time.Minute},
+
{D: 2 * time.Hour, Format: "1hr %s", DivBy: 1},
+
{D: humanize.Day, Format: "%dhrs %s", DivBy: time.Hour},
+
{D: 2 * humanize.Day, Format: "1d %s", DivBy: 1},
+
{D: 20 * humanize.Day, Format: "%dd %s", DivBy: humanize.Day},
+
{D: 8 * humanize.Week, Format: "%dw %s", DivBy: humanize.Week},
+
{D: humanize.Year, Format: "%dmo %s", DivBy: humanize.Month},
+
{D: 18 * humanize.Month, Format: "1y %s", DivBy: 1},
+
{D: 2 * humanize.Year, Format: "2y %s", DivBy: 1},
+
{D: humanize.LongTime, Format: "%dy %s", DivBy: humanize.Year},
+
{D: math.MaxInt64, Format: "a long while %s", DivBy: 1},
})
},
"longTimeFmt": func(t time.Time) string {
+1 -1
appview/reporesolver/resolver.go
···
func (f *ResolvedRepo) RolesInRepo(u *oauth.User) repoinfo.RolesInRepo {
if u != nil {
r := f.rr.enforcer.GetPermissionsInRepo(u.Did, f.Knot, f.DidSlashRepo())
-
return repoinfo.RolesInRepo{r}
} else {
return repoinfo.RolesInRepo{}
}
···
func (f *ResolvedRepo) RolesInRepo(u *oauth.User) repoinfo.RolesInRepo {
if u != nil {
r := f.rr.enforcer.GetPermissionsInRepo(u.Did, f.Knot, f.DidSlashRepo())
+
return repoinfo.RolesInRepo{Roles: r}
} else {
return repoinfo.RolesInRepo{}
}
+1 -1
appview/spindles/spindles.go
···
}
w.Header().Set("HX-Reswap", "outerHTML")
-
s.Pages.SpindleListing(w, pages.SpindleListingParams{verifiedSpindle[0]})
}
func (s *Spindles) addMember(w http.ResponseWriter, r *http.Request) {
···
}
w.Header().Set("HX-Reswap", "outerHTML")
+
s.Pages.SpindleListing(w, pages.SpindleListingParams{Spindle: verifiedSpindle[0]})
}
func (s *Spindles) addMember(w http.ResponseWriter, r *http.Request) {
+1 -1
appview/state/state.go
···
repoResolver := reporesolver.New(config, enforcer, res, d)
-
wrapper := db.DbWrapper{d}
jc, err := jetstream.NewJetstreamClient(
config.Jetstream.Endpoint,
"appview",
···
repoResolver := reporesolver.New(config, enforcer, res, d)
+
wrapper := db.DbWrapper{Execer: d}
jc, err := jetstream.NewJetstreamClient(
config.Jetstream.Endpoint,
"appview",
+4
.tangled/workflows/test.yml
···
command: |
mkdir -p appview/pages/static; touch appview/pages/static/x
- name: run all tests
environment:
CGO_ENABLED: 1
···
command: |
mkdir -p appview/pages/static; touch appview/pages/static/x
+
- name: run vet
+
command: |
+
go vet ./...
+
- name: run all tests
environment:
CGO_ENABLED: 1