Normally, it is sufficient to grab the Go MSI installer from the website in order to set up the toolchain. However, some packages that provide Go wrappers for C libraries rely on cgo tool, which in turn, needs the GCC toolchain in order to build the glue code. Also, 3rd-party dependencies are usually hosted on services like GitHub, thus Git is also needed. This mini-guide illustrates how to setup a convenient development environment on Windows using MSYS2.
This file contains 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
typedef struct Mutex { | |
int locked; | |
} Mutex; | |
typedef struct Semaphore { | |
int count; | |
Mutex mutex; | |
} Semaphore; | |
This file contains 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
Printing data for range: 1992-1992 | |
Nodes: 755 | |
Edges: 152 | |
Average degree: 0.201325 | |
Degree Distribution: | |
0 650 | |
1 74 | |
2 20 |
This file contains 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
Printing data for range: 1963-1963 | |
Nodes: 45679 | |
Edges: 0 | |
Average degree: 0 | |
Degree Distribution: | |
0 45679 | |
This file contains 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
Printing data for range: 1992-1992 | |
Nodes: 97444 | |
Edges: 2096 | |
Average degree: 0.0215098 | |
Degree Distribution: | |
0 95701 | |
1 1473 | |
2 216 |
This file contains 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
import sys | |
if __name__ == '__main__': | |
filename = sys.argv[1] | |
print(filename) | |
with open(filename, 'r') as f: | |
count = 0 | |
prev = 0 |
This file contains 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
[0] Running command: allocate CHAR s1 500 "fail" | |
Error: insufficient memory to allocate variable | |
[1] Running command: map | |
MEMORY MAP: | |
| 0 1 2 3 | 4 5 6 7 | 8 9 A B | C D E F | | |
---------------------------------------------------------------- | |
0x0000 | _ _ _ _ | _ _ _ _ | _ _ _ _ | _ _ _ _ | | |
0x0010 | _ _ _ _ | _ _ _ _ | _ _ _ _ | _ _ _ _ | |
This file contains 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
[0] Running command: allocate CHAR s1 500 "fail" | |
Error: insufficient memory to allocate variable | |
[1] Running command: map | |
MEMORY MAP: | |
| 0 1 2 3 | 4 5 6 7 | 8 9 A B | C D E F | | |
---------------------------------------------------------------- | |
0x0000 | _ _ _ _ | _ _ _ _ | _ _ _ _ | _ _ _ _ | | |
0x0010 | _ _ _ _ | _ _ _ _ | _ _ _ _ | _ _ _ _ | |
This file contains 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
7 | |
13 | |
47 | |
allocate CHAR s1 200 "fail" | |
allocate CHAR s1 20 " a" | |
allocate CHAR s2 4 "b " | |
allocate CHAR s3 5 " c " | |
allocate CHAR s4 8 " d d " | |
allocate CHAR s5 4 "" | |
allocate CHAR s6 16 " " |
NewerOlder