Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check go fmt during lint #1097

Merged
merged 1 commit into from Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/lint.yml
Expand Up @@ -8,9 +8,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: GolangCI-Lint Action
uses: golangci/golangci-lint-action@v2
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- run: go version
- run: diff -u <(echo -n) <(gofmt -d .)
- uses: golangci/golangci-lint-action@v2
with:
version: v1.28.3
2 changes: 1 addition & 1 deletion bytesconv.go
Expand Up @@ -11,11 +11,11 @@ import (
"math"
"net"
"reflect"
"runtime"
"strings"
"sync"
"time"
"unsafe"
"runtime"
)

// AppendHTMLEscape appends html-escaped s to dst and returns the extended dst.
Expand Down
10 changes: 5 additions & 5 deletions header.go
Expand Up @@ -271,11 +271,11 @@ func (h *RequestHeader) SetContentLength(contentLength int) {
func (h *ResponseHeader) isCompressibleContentType() bool {
contentType := h.ContentType()
return bytes.HasPrefix(contentType, strTextSlash) ||
bytes.HasPrefix(contentType, strApplicationSlash) ||
bytes.HasPrefix(contentType, strImageSVG) ||
bytes.HasPrefix(contentType, strImageIcon) ||
bytes.HasPrefix(contentType, strFontSlash) ||
bytes.HasPrefix(contentType, strMultipartSlash)
bytes.HasPrefix(contentType, strApplicationSlash) ||
bytes.HasPrefix(contentType, strImageSVG) ||
bytes.HasPrefix(contentType, strImageIcon) ||
bytes.HasPrefix(contentType, strFontSlash) ||
bytes.HasPrefix(contentType, strMultipartSlash)
}

// ContentType returns Content-Type header value.
Expand Down
12 changes: 6 additions & 6 deletions strings.go
Expand Up @@ -73,10 +73,10 @@ var (
strBytes = []byte("bytes")
strBasicSpace = []byte("Basic ")

strApplicationSlash = []byte("application/")
strImageSVG = []byte("image/svg")
strImageIcon = []byte("image/x-icon")
strFontSlash = []byte("font/")
strMultipartSlash = []byte("multipart/")
strTextSlash = []byte("text/")
strApplicationSlash = []byte("application/")
strImageSVG = []byte("image/svg")
strImageIcon = []byte("image/x-icon")
strFontSlash = []byte("font/")
strMultipartSlash = []byte("multipart/")
strTextSlash = []byte("text/")
)