Go line-length-linter: How to ignore one line?

11.2k Views Asked by At

I get this warning:

main.go:72: line is 191 characters (lll) klog.Fatalf("no ...") //nolint:lll

I added nolint:lll, but this does not silence this warning.

We use https://golangci-lint.run/

I want to ignore this line only (no global configuration).

1

There are 1 best solutions below

0
On

I am not sure but I think klog.Fatalf() is nothing but a block of code.

Could you please try the below suggestions:

//nolint:all
klog.Fatalf("no ...")

OR

klog.Fatalf("no ...") //nolint:all

OR

klog.Fatalf("no ...") //nolint:golint,unused

For the reference you can refer this link