Is there any way to force you to ignore errors in Go?

Asked

Viewed 114 times

1

Golang forces us to manually remove unused items in the code, for example:

for index, item := range retorno.Threads {
    fmt.Fprint(w, item.Id)
}

If you run a go run .... he will say:

index declared and not used

And as a result will not run application. The same applies when using a import and does not use it in the code, as a result:

Imported and not used: "(name)"


Well, I understand how to fix these kinds of mistakes, this is not the question.

The question is many of the times I’m just testing something to see if it works, out of curiosity, a simple table edition that requires me to change other parts, for example by removing a library that I just stopped using.

Is there any way to ignore the error? Is there any way to automatically fix the errors, such as removing unused libraries?

2 answers

2


0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.