<p dir="auto">There are two files,main.go and main1.go</p>
<p dir="auto">-------------------------content of main.go----------------------------------------<br>
package main<br>
import "code.google.com/p/go.net/websocket"<br>
func main() {<br>
websocketConn := websocket.Conn{}<br>
TestFunc(&amp;websocketConn)<br>
}<br>
----------------------------------end of main.go--------------------------------------------------<br>
----------------------content of main1.go------------------------------------------<br>
package main<br>
import (<br>
"fmt"<br>
"net"<br>
"reflect"<br>
"golang.org/x/net/websocket"<br>
)</p>
<p dir="auto">func TestFunc(conn net.Conn) {<br>
switch conn.(type) {<br>
case *websocket.Conn:<br>
fmt.Println("OK")<br>
default:<br>
fmt.Println("NOT")<br>
}<br>
}<br>
----------------------------------------end of main1.go----------------------------------------------<br>
We should get OK from console by running this program on windows 10 compiling with go 1.5.2,but I got NOT,when I moved TestFunc to file main.go,then I got OK</p>
<p dir="auto">There are two files,main.go and main1.go</p>
<p dir="auto">-------------------------content of main.go----------------------------------------<br>
package main<br>
import "code.google.com/p/go.net/websocket"<br>
func main() {<br>
conn := websocket.Conn{}<br>
TestFunc(&amp;conn)<br>
}<br>
----------------------------------end of main.go--------------------------------------------------<br>
----------------------content of main1.go------------------------------------------<br>
package main<br>
import (<br>
"fmt"<br>
"net"<br>
"reflect"<br>
"golang.org/x/net/websocket"<br>
)</p>
<p dir="auto">func TestFunc(conn net.Conn) {<br>
switch  conn.(type) {<br>
case *websocket.Conn:<br>
fmt.Println("OK")<br>
default:<br>
fmt.Println("NOT")<br>
}<br>
}<br>
----------------------------------------end of main1.go----------------------------------------------<br>
We should get OK from console by running this program on windows 10 compiling with go 1.5.2,but I got NOT,when I moved TestFunc to file main.go,then I got OK</p>