GoProgramming.pdf

(4830 KB) Pobierz
UOHN P. BAUGH
Go
Programming
779404860.010.png 779404860.011.png 779404860.012.png 779404860.013.png 779404860.001.png 779404860.002.png
779404860.003.png 779404860.004.png 779404860.005.png 779404860.006.png
 
Go Programming
John P. Baugh
1
779404860.007.png
ISBN: 1453636676
E~-13: 9781453636671
©John P. Baugh, 2010
2
779404860.008.png
TABLE OF CONTENTS
What is This Book About and Who is It For?.....................6
About the Author.................................................................8
1.1 Why a New Language?............................................... 10
1.2 How Does Go Compare with C++?............................ 10
1.2.1 Functions ............................................................. 11
1.2.2 Is Go Object Oriented like C++? ........................ 12
1.2.3 How do I free memory in Go? ............................ 14
1.2.4 Other stuff to be aware of.................................... 14
1.3 Summary..................................................................... 16
2.1 What Platforms can I install Go on?........................... 17
2.2 But what if I'm a Windows user?............................... 18
2.2.1 Virtual Machine................................................... 19
2.2.2 Dual Booting with Ubuntu...................................20
2.3 Installing Go................................................................22
2.3.1 Environment Variables........................................23
2.3.2 Installing Mercurial.. ............................................24
2.3.3 Fetching the Go Repository.................................27
2.3.4 Installing Go.........................................................27
2.4 Compiling, Linking, and Running..............................28
2.4.1 What About gccgo?..............................................29
2.5 Summary.....................................................................30
3.1 Standard 1/0................................................................33
3.1.1 The Obligatory "Hello World"............................ 33
3.1.2 Retrieving Input from the User............................35
3.2 File 1/0........................................................................38
3.2.1 Output to a File.................................................... 38
3.2.2 Input from a File..................................................43
3.2.3 A Short Summary of Permissions........................47
3.3 Constants and Variables..............................................50
3.3.1 Identifiers............................................................. 50
3.3.2 Constants..............................................................51
3.3.3 Variables.............................................................. 53
3.3.4 Time Savers : Short Declarations and Distributing
.............. ,.........................................................................55
3
779404860.009.png
Zgłoś jeśli naruszono regulamin