News for hackers. Stuff that matters.
Re:Go Analysis Framework: modular static analysis by go team by rowanG077 on Monday July 27, 2026 @04:25AM (#49066630)
Are you really being so obtuse? Of course in real code you might use the error. For printing, forwarding it to a logging frame or anything else. The point is the error does not guard access to the return value. Here basically the same example:

package main

import ( "errors" "fmt" )

func getMessage() (string, error) { return "DO NOT INSPECT", errors.New("something went wrong") }

func main() { msg, err := getMessage() fmt.Println(msg) fmt.Println(err) }

There are no comments on this comment yet.