You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is an issue:
If you make a package:
package pkg
type NopWriter struct{}
func Write([]byte) (int, error)
Notice, how I forgot to define the function. The compiler produces no error.
However, if you use this in a program:
package main
import ("log"; "pkg")
func main() {
log.New(NopWriter{}, "", 0)
}
The linker will report the error.
Maybe the compiler should be catching this?
hg id = 46ca86e70e96
darwin
amd64
The text was updated successfully, but these errors were encountered:
Working as intended. Forward declarations are used to provide signatures for functions
from other languages, such as assembly functions. The absence of a definition cannot be
detected until link time.
The text was updated successfully, but these errors were encountered: