1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:22:22 +00:00

Update ch2-02-basic.md

在windows下, 有static的话 会报错。其它平台不知道。

```
# command-line-arguments
C:\Users\ADMINI~1\AppData\Local\Temp\go-build177025346\b001\_cgo_main.o:_cgo_main.c:(.data+0x0): undefined reference to `os'
collect2.exe: error: ld returned 1 exit status
```
This commit is contained in:
smallwhite 2019-01-18 18:33:31 +08:00 committed by GitHub
parent 46bbb0e350
commit 1515822564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,7 @@ package main
#cgo linux CFLAGS: -DCGO_OS_LINUX=1
#if defined(CGO_OS_WINDOWS)
static const char* os = "windows";
const char* os = "windows";
#elif defined(CGO_OS_DARWIN)
static const char* os = "darwin";
#elif defined(CGO_OS_LINUX)