This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func main() { | |
fmt.Println("Hello, 世界!") | |
fmt.Println("GOOS:", runtime.GOOS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"net/http" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RemoteAddr allows HTTP servers and other software to record | |
// the network address that sent the request, usually for | |
// logging. This field is not filled in by ReadRequest and | |
// has no defined format. The HTTP server in this package | |
// sets RemoteAddr to an "IP:port" address before invoking a | |
// handler. | |
// This field is ignored by the HTTP client. | |
RemoteAddr string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inc(n int) int | |
00000 TEXT "".inc(SB), $32-16 ; function definition | |
00000 MOVQ (TLS), CX ; move TLS to register CX | |
00009 CMPQ SP, 16(CX) ; compare SP with part of CX | |
00013 JLS 88 ; go to line 88 if 'less than' | |
00015 SUBQ $32, SP ; increase stack size by 32-bytes | |
00019 MOVQ BP, 24(SP) ; move BP to the stack | |
00024 LEAQ 24(SP), BP ; update BP to new location | |
; --- --- | |
00029 XORL AX, AX ; zero out register AX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
n := inc(1000) | |
println(n) | |
} | |
func inc(n int) int { | |
for i := 0; i < 1000; i++ { | |
n = add(n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inc(n int) int | |
00000 TEXT "".inc(SB), NOSPLIT, $0-16 ; function definition | |
00000 MOVQ "".n+8(SP), AX ; move parameter from stack to AX | |
00005 XORL CX, CX ; zero out register CX | |
00007 JMP 15 ; go to line 15 | |
00009 INCQ CX ; increment register CX | |
00012 INCQ AX ; increment register AX | |
00015 CMPQ CX, $1000 ; compare register CX with 1000 | |
00022 JLT 9 ; go to line 9 | |
00024 MOVQ AX, "".~r1+16(SP) ; move AX to stack return value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; inc(n int) int | |
00000 TEXT "".inc(SB), NOSPLIT, $0-16 ; function definition | |
00000 MOVQ "".n+8(SP), AX ; move parameter from stack to AX | |
00005 XORL CX, CX ; zero out register CX | |
00007 JMP 15 ; go to line 15 | |
00009 INCQ CX ; increment register CX | |
00012 INCQ AX ; increment register AX | |
00015 CMPQ CX, $1000 ; compare register CX with 1000 | |
00022 JLT 9 ; go to line 9 | |
00024 MOVQ AX, "".~r1+16(SP) ; move AX to stack return value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x0000 00000 (inline.go:8) TEXT "".inc(SB), NOSPLIT, $0-16 | |
0x0000 00000 (inline.go:8) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) | |
0x0000 00000 (inline.go:8) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) | |
0x0000 00000 (inline.go:8) FUNCDATA $3, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB) | |
0x0000 00000 (inline.go:9) PCDATA $2, $0 | |
0x0000 00000 (inline.go:9) PCDATA $0, $0 | |
0x0000 00000 (inline.go:9) MOVQ "".n+8(SP), AX | |
0x0005 00005 (inline.go:9) XORL CX, CX | |
0x0007 00007 (inline.go:9) JMP 15 | |
0x0009 00009 (inline.go:9) INCQ CX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
n := inc(1000) | |
println(n) | |
} | |
func inc(n int) int { | |
for i := 0; i < 1000; i++ { | |
n = add(n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
n := inc(1000) | |
println(n) | |
} | |
func inc(n int) int { | |
for i := 0; i < 1000; i++ { | |
n = n + 1 |