diff --git a/.circleci/config.yml b/.circleci/config.yml index bb8fe945c..5f0e29313 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,7 +89,7 @@ jobs: command: | bash <(curl -s https://codecov.io/bash) - lint: + lint: &lint description: | Run golangci-lint. parameters: @@ -124,15 +124,20 @@ jobs: command: | golangci-lint run -v \ --concurrency << parameters.concurrency >> << parameters.args >> + lint-changes: + <<: *lint + + lint-all: + <<: *lint workflows: version: 2 ci: jobs: - - lint - - lint: - args: "--no-config --exclude-use-default=false --disable-all --enable golint" + - lint-changes: + args: "--new-from-rev origin/master" + - lint-all - test: codecov-upload: true - mod-tidy-check diff --git a/.golangci.yml b/.golangci.yml index f873557aa..8f25233e6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,7 +20,6 @@ issues: exclude: - "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this" - "Potential file inclusion via variable" - - "should have( a package)? comment" exclude-use-default: false exclude-rules: diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index 88ad688a6..cfcb52f8d 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -25,12 +25,14 @@ const ( fsLock = "repo.lock" ) +// FsRepo is struct for repo, use NewFS to create type FsRepo struct { path string } var _ Repo = &FsRepo{} +// APIEndpoint returns endpoint of API in this repo func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) { p := filepath.Join(fsr.path, fsAPI) f, err := os.Open(p) @@ -56,6 +58,7 @@ func (fsr *FsRepo) APIEndpoint() (multiaddr.Multiaddr, error) { return apima, nil } +// Lock acquires exclusive lock on this repo func (fsr *FsRepo) Lock() (LockedRepo, error) { closer, err := fslock.Lock(fsr.path, fsLock) if err != nil {