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

A few code cleanups as suggested by staticcheck #57

Merged
merged 1 commit into from Apr 29, 2021
Merged

A few code cleanups as suggested by staticcheck #57

merged 1 commit into from Apr 29, 2021

Conversation

Jacalz
Copy link
Contributor

@Jacalz Jacalz commented Apr 24, 2021

This commits adds in a few suggestions that I got from staticcheck. I also cleaned up a bit further in some cases.
Below are the report from staticcheck:

/home/jacob/Downloads/gval/evaluable.go
  (300, 25)  SA1012  do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
  (332, 25)  SA1012  do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use

/home/jacob/Downloads/gval/language.go
  (258, 2)  SA6003  should range over string, not []rune(string)

/home/jacob/Downloads/gval/operator.go
  (107, 2)  S1023  redundant return statement

/home/jacob/Downloads/gval/parse.go
  (123, 3)  S1005  unnecessary assignment to the blank identifier

/home/jacob/Downloads/gval/parser.go
  (22, 46)  S1023  redundant return statement
  (84, 2)   S1023  redundant return statement

/home/jacob/Downloads/gval/random_test.go
  (16, 2)   U1000  var empty3 is unused
  (105, 2)  U1000  var panics is unused

This commits adds in a few suggestions that I got from staticcheck. I also cleaned up a bit further in some cases.

/home/jacob/Downloads/gval/evaluable.go
  (300, 25)  SA1012  do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use
  (332, 25)  SA1012  do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use

/home/jacob/Downloads/gval/language.go
  (258, 2)  SA6003  should range over string, not []rune(string)

/home/jacob/Downloads/gval/operator.go
  (107, 2)  S1023  redundant return statement

/home/jacob/Downloads/gval/parse.go
  (123, 3)  S1005  unnecessary assignment to the blank identifier

/home/jacob/Downloads/gval/parser.go
  (22, 46)  S1023  redundant return statement
  (84, 2)   S1023  redundant return statement

/home/jacob/Downloads/gval/random_test.go
  (16, 2)   U1000  var empty3 is unused
  (105, 2)  U1000  var panics is unused
@generikvault generikvault merged commit 4f5f9c0 into PaesslerAG:master Apr 29, 2021
@generikvault
Copy link
Collaborator

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants