Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nolint with reasons to ignore unwanted lint issues #83

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions yos/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func SameFileContent(path1, path2 string) (same bool, err error) {
}

// SameDirEntries checks if the two directories have the same entries. Symbolic links other than the given paths will be not be followed, and only compares content of links.
//nolint:gocyclo // Checks in this function are all necessary, no redundant checks.
func SameDirEntries(path1, path2 string) (same bool, err error) {
var (
fi1, fi2 os.FileInfo
Expand Down
2 changes: 2 additions & 0 deletions yos/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func CopySymlink(src, dest string) (err error) {
}

// bufferCopyFile reads content from the source file and write to the destination file with a buffer.
//nolint:gocyclo // buffer copy is a complicated thing indeed.
func bufferCopyFile(src, dest string, bufferSize int64) (err error) {
var (
srcFile, destFile *os.File
Expand Down Expand Up @@ -161,6 +162,7 @@ func copySymlink(src, dest string) (err error) {
}

// copyDir copies all entries of source directory to destination directory recursively.
//nolint:gocyclo // copy directory refers itself with copy file and copy symlink, it's hard to reduce the complexity.
func copyDir(src, dest string) (err error) {
var srcInfo, destInfo os.FileInfo

Expand Down
1 change: 1 addition & 0 deletions yrand/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
var (
// QuitShuffle is used as a return value from ShuffleIndexFunc to indicate that the execution of WeightedShuffle should be terminated immediately.
// It is not returned as an error by any function.
//nolint:golint // this is not a real error returned by any functions, it works as a flag instead.
QuitShuffle = errors.New("quit this shuffle")
)

Expand Down