CreateSpace Independent Publishing Platform, 2012. — 166 p. — ISBN: 1478355824, 9781478355823.
This book is a short, concise introduction to computer programming using the language Go. Designed by Google, Go is a general purpose programming language with modern features, clean syntax and a robust well-documented common library, making it an ideal language to learn as your first programming language.
Computer programming is the art, craft and science of writing programs which define how computers operate.
This book will teach you how to write computer programs using a programming language designed by Google named Go.
Go is a general purpose programming language with advanced features and a clean syntax. Because of its wide availability on a variety of platforms, its robust well‑documented common library, and its focus on good software engineering principles, Go is an ideal language to learn as your first programming language.
The process we use to write software using Go (and most programming languages) is fairly straightfor-ward:
gather requirements;
find a solution;
write source code to implement the solution;
compile the source code into an executable;
run and test the program to make sure it works.
This process is iterative (meaning its done many times) and the steps usually overlap. But before we write our first program in Go there are a few prerequisite concepts we need to understand.
Getting Started.Files and Folders.
The Terminal.
Text Editors.
Go Tools.
Your First Program.How to Read a Go Program.
Types.Numbers.
Strings.
Booleans.
Variables.How to Name a Variable.
Scope.
Constants.
Defining Multiple Variables.
An Example Program.
Control Structures.For.
If.
Switch.
Arrays, Slices and Maps.Arrays.
Slices.
Maps.
Functions.Your Second Function.
Returning Multiple Values.
Variadic Functions.
Closure.
Recursion.
Defer, Panic & Recover.
Pointers.The * and & operators.
new.
Structs and Interfaces.Structs.
Methods.
Interfaces.
Concurrency.Goroutines.
Channels.
Packages.Creating Packages.
Documentation.
Testing.The Core Packages.Strings.
Input / Output.
Files & Folders.
Errors.
Containers & Sort.
Hashes & Cryptography.
Servers.
Parsing Command Line Arguments.
Synchronization Primitives.
Next Steps.Study the Masters.
Make Something.
Team Up.
An Introduction to Programming in Go Copyright 2012 by Caleb Doxsey All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system without the written permission of the author, except where permitted by law.
Portions of this text are reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
Cover art by Abigail Doxsey Anderson.