Skip to content

Commit

Permalink
Check go fmt during lint
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Sep 10, 2021
1 parent 713da4e commit bdd293c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
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/")
)

0 comments on commit bdd293c

Please sign in to comment.