forked from transcode-open/apt-cyg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified: go/go-cyg.go
- Loading branch information
Steven Penny
committed
Apr 17, 2015
1 parent
83fb7b8
commit 27570ba
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Why Go? | ||
|
||
Consider this Python script | ||
|
||
~~~py | ||
print("Hello world") | ||
~~~ | ||
|
||
You can compile it for Windows like this | ||
|
||
build_exe --bundle-files 0 --compress --optimize hello.py | ||
upx -9 hello.exe | ||
|
||
and it comes out to 4.16 MB. Now consider this Go script | ||
|
||
~~~go | ||
package main | ||
import "fmt" | ||
func main() { | ||
fmt.Println("Hello world") | ||
} | ||
~~~ | ||
|
||
You can compile it like this | ||
|
||
go build -ldflags -s hello.go | ||
upx -9 hello.exe | ||
|
||
and it comes out to 375 KB. Something else to consider is that Python is built | ||
with Visual C++ 2010. That means that the program you create will not work on | ||
Windows 7 for example unless the user has installed Visual C++ 2010. Go is built | ||
with Visual C++ 6, this means that any programs created with Go will work on | ||
Windows 7 as is. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,5 @@ func foxtrot() { | |
func main() { | ||
foxtrot() | ||
// parse ini | ||
// category: Base | ||
} |