Fix golint errors

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-02-02 15:24:11 +01:00
parent b11ce54ccc
commit ece54f1616
38 changed files with 134 additions and 204 deletions

View File

@@ -75,7 +75,7 @@ var (
)
func methodNotAllowed(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
defer func() { _ = r.Body.Close() }()
httpserver.RenderJSON(
w,
@@ -87,7 +87,7 @@ func methodNotAllowed(w http.ResponseWriter, r *http.Request) {
}
func notFound(w http.ResponseWriter, r *http.Request) {
defer r.Body.Close()
defer func() { _ = r.Body.Close() }()
httpserver.RenderJSON(
w,

View File

@@ -35,8 +35,8 @@ type Datum struct {
UpdatedAt time.Time `json:"updatedAt"`
}
func (Datum) IsNode() {}
func (this Datum) GetID() gid.GID { return this.ID }
func (Datum) IsNode() {}
func (d Datum) GetID() gid.GID { return d.ID }
type (
DatumOrderBy OrderBy[coredata.DatumOrderField]

View File

@@ -44,8 +44,8 @@ type (
}
)
func (SignableDocument) IsNode() {}
func (this SignableDocument) GetID() gid.GID { return this.ID }
func (SignableDocument) IsNode() {}
func (d SignableDocument) GetID() gid.GID { return d.ID }
func NewSignableDocumentConnection(
p *page.Page[*SignableDocument, coredata.DocumentOrderField],

View File

@@ -2612,7 +2612,7 @@ func (r *mutationResolver) ExportFramework(ctx context.Context, input types.Expo
prb := r.ProboService(ctx, input.FrameworkID.TenantID())
identity := authn.IdentityFromContext(ctx)
exportErr, exportJobID := prb.Frameworks.RequestExport(
exportJob, exportErr := prb.Frameworks.RequestExport(
ctx,
input.FrameworkID,
identity.EmailAddress,
@@ -2624,7 +2624,7 @@ func (r *mutationResolver) ExportFramework(ctx context.Context, input types.Expo
}
return &types.ExportFrameworkPayload{
ExportJobID: exportJobID.ID,
ExportJobID: exportJob.ID,
}, nil
}

View File

@@ -66,7 +66,7 @@ func (e *SessionRequirement) UnmarshalGQL(v any) error {
}
func (e SessionRequirement) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
_, _ = fmt.Fprint(w, strconv.Quote(e.String()))
}
func (e *SessionRequirement) UnmarshalJSON(b []byte) error {

View File

@@ -26,7 +26,7 @@ type BigIntScalar = int64
func MarshalBigIntScalar(i int64) graphql.Marshaler {
return graphql.WriterFunc(func(w io.Writer) {
w.Write([]byte(strconv.FormatInt(i, 10)))
_, _ = w.Write([]byte(strconv.FormatInt(i, 10)))
})
}

View File

@@ -26,9 +26,11 @@ import (
type GIDScalar = gid.GID
func MarshalGIDScalar(id gid.GID) graphql.Marshaler {
return graphql.WriterFunc(func(w io.Writer) {
w.Write([]byte(strconv.Quote(id.String())))
})
return graphql.WriterFunc(
func(w io.Writer) {
_, _ = w.Write([]byte(strconv.Quote(id.String())))
},
)
}
func UnmarshalGIDScalar(v interface{}) (gid.GID, error) {

View File

@@ -26,9 +26,11 @@ import (
type AddrScalar = mail.Addr
func MarshalAddrScalar(a mail.Addr) graphql.Marshaler {
return graphql.WriterFunc(func(w io.Writer) {
w.Write([]byte(strconv.Quote(a.String())))
})
return graphql.WriterFunc(
func(w io.Writer) {
_, _ = w.Write([]byte(strconv.Quote(a.String())))
},
)
}
func UnmarshalAddrScalar(v interface{}) (mail.Addr, error) {

View File

@@ -77,7 +77,7 @@ func NewServer(staticFiles fs.FS, distPath string, gzipOptions GzipOptions) (*Se
if err != nil {
return err
}
defer file.Close()
defer func() { _ = file.Close() }()
_, err = file.Read(content)
if err != nil {
@@ -136,11 +136,11 @@ func (s *Server) ServeSPA(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.WriteHeader(http.StatusOK)
w.Write(s.indexContent)
_, _ = w.Write(s.indexContent)
return
}
defer f.Close()
defer func() { _ = f.Close() }()
info, err := f.Stat()
if err != nil {
@@ -162,7 +162,7 @@ func (s *Server) ServeSPA(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Expires", "0")
w.WriteHeader(http.StatusOK)
w.Write(s.indexContent)
_, _ = w.Write(s.indexContent)
return
}
@@ -225,7 +225,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if s.shouldCompressWithGzip(r) {
w.Header().Set("Content-Encoding", "gzip")
gz := gzip.NewWriter(w)
defer gz.Close()
defer func() { _ = gz.Close() }()
gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
s.ServeSPA(gzw, r)