diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-27 23:33:11 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-27 23:33:11 +0800 |
commit | 4424943ffcb276102e68646d306cdcdcab8d2f71 (patch) | |
tree | 00186227f44b91066e0485323bf28b3542ecd51e | |
parent | Lint (diff) | |
download | forge-4424943ffcb276102e68646d306cdcdcab8d2f71.tar.gz forge-4424943ffcb276102e68646d306cdcdcab8d2f71.tar.zst forge-4424943ffcb276102e68646d306cdcdcab8d2f71.zip |
Lint and add CI
-rw-r--r-- | .build.yml | 19 | ||||
-rw-r--r-- | http_handle_repo_raw.go | 2 | ||||
-rw-r--r-- | http_handle_repo_tree.go | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..38e2571 --- /dev/null +++ b/.build.yml @@ -0,0 +1,19 @@ +image: alpine/edge +packages: + - go + - golangci-lint + - make + - gcc + - musl-dev +sources: + - ssh://forge.lindenii.runxiyu.org/lindenii/forge/:/repos/server/ +tasks: + - prepare: | + cd server + git checkout go + - build: | + cd server + make + - lint: | + cd server + golangci-lint run . diff --git a/http_handle_repo_raw.go b/http_handle_repo_raw.go index 36e59d7..aab64b6 100644 --- a/http_handle_repo_raw.go +++ b/http_handle_repo_raw.go @@ -33,7 +33,7 @@ func httpHandleRepoRaw(writer http.ResponseWriter, request *http.Request, params } refHashSlice = refHash[:] - cacheHandle := append(refHashSlice, []byte(pathSpec)...) + cacheHandle := append(refHashSlice, []byte(pathSpec)...) //nolint:gocritic if value, found := treeReadmeCache.Get(cacheHandle); found { params["files"] = value.DisplayTree diff --git a/http_handle_repo_tree.go b/http_handle_repo_tree.go index 7d95c02..1bb9940 100644 --- a/http_handle_repo_tree.go +++ b/http_handle_repo_tree.go @@ -39,7 +39,7 @@ func httpHandleRepoTree(writer http.ResponseWriter, request *http.Request, param } refHashSlice = refHash[:] - cacheHandle := append(refHashSlice, []byte(pathSpec)...) + cacheHandle := append(refHashSlice, []byte(pathSpec)...) //nolint:gocritic if value, found := treeReadmeCache.Get(cacheHandle); found { params["files"] = value.DisplayTree |