|
|
|
|
|
by rowanG077
2 days ago
|
|
Did you ever use go? ```
package main import (
"errors"
"fmt"
) func getMessage() (string, error) {
return "DO NOT INSPECT", errors.New("something went wrong")
} func main() {
msg, _ := getMessage() // Ignore the error.
fmt.Println(msg)
}
``` Compiles normally and prints "DO NOT INSPECT" |
|
Don't make me spit my tea. That monitor is expensive. Of course, yes: https://git.sr.ht/~bayindirh/nudge
Jokes aside...
You used "_" to ignore the error variable, which I call "IDGAF" placeholder.
So, you willingly ignored the error and tell me that you don't have to check the error? You told the compiler that you don't care about the error explicitly (via "_"). That's on you then.
In my first comment I noted in the P.S. section:
You used "_" knowingly. Compiler/linter didn't add it there by itself.I mean, do you even read the language documents to understand how a language works?