diff options
-rw-r--r-- | .build.yml | 5 | ||||
-rw-r--r-- | handler.go | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,7 @@ image: fedora/latest packages: - go + - tar sources: - https://git.sr.ht/~yotam/go-gemini-server - https://git.sr.ht/~sircmpwn/annotatego @@ -8,8 +9,12 @@ secrets: - f43da1db-697d-4101-8607-e96f574b035a tasks: - lint: | + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 + go get honnef.co/go/tools/cmd/staticcheck cd go-gemini-server go vet + ~/go/bin/staticcheck + ~/go/bin/golangci-lint run - test: | cd go-gemini-server go test @@ -28,7 +28,7 @@ func (h Handler) urlAbsPath(rawURL string) (string, error) { } if !strings.HasPrefix(itemPath, h.cfg.SourceDir) { - return "", gemini.Error{Err: fmt.Errorf("Permission Denied"), Status: gemini.StatusBadRequest} + return "", gemini.Error{Err: fmt.Errorf("permission denied"), Status: gemini.StatusBadRequest} } return itemPath, nil @@ -58,7 +58,7 @@ func (h Handler) getFilePath(rawURL string) (string, error) { return indexPath, nil } - return "", gemini.Error{Err: fmt.Errorf("File Not Found"), Status: gemini.StatusNotFound} + return "", gemini.Error{Err: fmt.Errorf("file not found"), Status: gemini.StatusNotFound} } // Handle implement the gemini.Handler interface by serving files from a given source directory |