Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hiifong committed Dec 30, 2024
1 parent 92c5c37 commit 146b174
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/markup/common/footnote.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (b *footnoteBlockParser) Open(parent ast.Node, reader text.Reader, pc parse
return nil, parser.NoChildren
}
open := pos + 1
closure := util.FindClosure(line[pos+1:], '[', ']', false, false) //nolint
closure := util.FindClosure(line[pos+1:], '[', ']', false, false)

Check failure on line 200 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-backend

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)

Check failure on line 200 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)

Check failure on line 200 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)
closes := pos + 1 + closure
next := closes + 1
if closure > -1 {
Expand Down Expand Up @@ -287,7 +287,7 @@ func (s *footnoteParser) Parse(parent ast.Node, block text.Reader, pc parser.Con
return nil
}
open := pos
closure := util.FindClosure(line[pos:], '[', ']', false, false) //nolint
closure := util.FindClosure(line[pos:], '[', ']', false, false)

Check failure on line 290 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-backend

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)

Check failure on line 290 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)

Check failure on line 290 in modules/markup/common/footnote.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

SA1019: util.FindClosure is deprecated: This function can not handle newlines. Many elements can be existed over multiple lines(e.g. link labels). Use text.Reader.FindClosure. (staticcheck)
if closure < 0 {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion modules/markup/mdstripper/mdstripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (r *stripRenderer) Render(w io.Writer, source []byte, doc ast.Node) error {
coalesce := prevSibIsText
r.processString(
w,
v.Text(source), //nolint:staticcheck
v.Text(source),

Check failure on line 49 in modules/markup/mdstripper/mdstripper.go

View workflow job for this annotation

GitHub Actions / lint-backend

SA1019: v.Text is deprecated: Use other properties of the node to get the text value(i.e. Text.Value). (staticcheck)

Check failure on line 49 in modules/markup/mdstripper/mdstripper.go

View workflow job for this annotation

GitHub Actions / lint-go-gogit

SA1019: v.Text is deprecated: Use other properties of the node to get the text value(i.e. Text.Value). (staticcheck)

Check failure on line 49 in modules/markup/mdstripper/mdstripper.go

View workflow job for this annotation

GitHub Actions / lint-go-windows

SA1019: v.Text is deprecated: Use other properties of the node to get the text value(i.e. Text.Value). (staticcheck)
coalesce)
if v.SoftLineBreak() {
r.doubleSpace(w)
Expand Down
8 changes: 4 additions & 4 deletions routers/api/packages/container/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ var (
errManifestBlobUnknown = &namedError{Code: "MANIFEST_BLOB_UNKNOWN", StatusCode: http.StatusNotFound, Message: "blob unknown to registry"}
errManifestInvalid = &namedError{Code: "MANIFEST_INVALID", StatusCode: http.StatusBadRequest, Message: "manifest invalid"}
errManifestUnknown = &namedError{Code: "MANIFEST_UNKNOWN", StatusCode: http.StatusNotFound, Message: "manifest unknown"}
errManifestUnverified = &namedError{Code: "MANIFEST_UNVERIFIED", StatusCode: http.StatusBadRequest, Message: "manifest failed signature verification"}
errManifestUnverified = &namedError{Code: "MANIFEST_UNVERIFIED", StatusCode: http.StatusBadRequest, Message: "manifest failed signature verification"} //nolint:unused
errNameInvalid = &namedError{Code: "NAME_INVALID", StatusCode: http.StatusBadRequest, Message: "invalid repository name"}
errNameUnknown = &namedError{Code: "NAME_UNKNOWN", StatusCode: http.StatusNotFound, Message: "repository name not known to registry"}
errPaginationNumberInvalid = &namedError{Code: "PAGINATION_NUMBER_INVALID", StatusCode: http.StatusBadRequest, Message: "invalid number of results requested"}
errRangeInvalid = &namedError{Code: "RANGE_INVALID", StatusCode: http.StatusBadRequest, Message: "invalid content range"}
errPaginationNumberInvalid = &namedError{Code: "PAGINATION_NUMBER_INVALID", StatusCode: http.StatusBadRequest, Message: "invalid number of results requested"} //nolint:unused
errRangeInvalid = &namedError{Code: "RANGE_INVALID", StatusCode: http.StatusBadRequest, Message: "invalid content range"} //nolint:unused
errSizeInvalid = &namedError{Code: "SIZE_INVALID", StatusCode: http.StatusBadRequest, Message: "provided length did not match content length"}
errTagInvalid = &namedError{Code: "TAG_INVALID", StatusCode: http.StatusBadRequest, Message: "manifest tag did not match URI"}
errUnauthorized = &namedError{Code: "UNAUTHORIZED", StatusCode: http.StatusUnauthorized, Message: "authentication required"}
errDenied = &namedError{Code: "DENIED", StatusCode: http.StatusForbidden, Message: "requested access to the resource is denied"}
errDenied = &namedError{Code: "DENIED", StatusCode: http.StatusForbidden, Message: "requested access to the resource is denied"} //nolint:unused
errUnsupported = &namedError{Code: "UNSUPPORTED", StatusCode: http.StatusMethodNotAllowed, Message: "The operation is unsupported"}
)

Expand Down

0 comments on commit 146b174

Please sign in to comment.