diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..e1c40ed --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,42 @@ +version: 2 +jobs: + lint: + docker: + - image: golangci/golangci-lint:v1.16 + steps: + - checkout + - run: golangci-lint run -v + build: + docker: + - image: circleci/golang:1.12 + steps: + - checkout + - run: cd cmd/webdav && go build main.go + release: + docker: + - image: circleci/golang:1.12 + steps: + - checkout + - run: curl -sL https://git.io/goreleaser | bash +workflows: + version: 2 + build-workflow: + jobs: + - lint: + filters: + tags: + only: /.*/ + - build: + filters: + tags: + only: /.*/ + - release: + context: deploy + requires: + - build + - lint + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9778ce9..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -config.yaml -config.yml -config.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aaa3406..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go - -go: 1.12.x - -env: - - "PATH=/home/travis/gopath/bin:$PATH GO111MODULE=on" - -install: - - go get ./... - # Install gometalinter and certain linters - - env GO111MODULE=off go get github.com/alecthomas/gometalinter - - env GO111MODULE=off gometalinter --install - -script: - - gometalinter --disable-all -E vet -E gofmt -E misspell -E ineffassign -E goimports -E deadcode --tests ./... - - go test ./... -timeout 30s - -after_success: - - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash diff --git a/cmd/webdav/main.go b/cmd/webdav/main.go index 9529bc1..44365c6 100644 --- a/cmd/webdav/main.go +++ b/cmd/webdav/main.go @@ -240,7 +240,7 @@ func basicAuth(c *cfg) http.Handler { w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`) username, password, authOK := r.BasicAuth() - if authOK == false { + if !authOK { http.Error(w, "Not authorized", 401) return }