Learn Go programming
$5.00
Minimum price
$6.00
Suggested price

Learn Go programming

Go Study Notes Version 1.0 dated 16th Aug. 2015

About the Book

About the Author

Satish Talim
Satish Talim

Satish Talim is the founder of RubyLearning, that helps Ruby programmers become awesome! He has more than 40 years of industrial experience and is a board member at Josh Software Pvt. Ltd. and Maybole Technologies Pvt. Ltd.

He is a trustee on the Emerging Technology Trust that organizes conferences in India like GopherConIndia and RubyConfIndia.

He has published many books on Amazon and was awarded Ruby's Top Teacher in 2008 and the winner of the Shorty Award in Education in 2009.

Follow @indianguru on Twitter or email him at satish@rubylearning.org

About the Contributors

Victor Goff
Victor Goff

Reviewer

Manages RubyLearning sites and teaches Go and Ruby

Table of Contents

  • Preface
    • Who is the eBook for?
    • What will you learn?
    • Using code examples
    • Errata
    • Acknowledgements
    • How to contact me?
    • Thanks
  • How to use this eBook
  • 1. Introduction
    • 1.1 What is Go?
    • 1.2 Go Recent History
    • 1.3 Go Authors
    • 1.4 Why Go?
  • 2. Learn Go programming
    • 2.1 Comments
    • 2.2 Statements
    • 2.3 Identifiers
      • 2.3.1 Blank identifier
      • 2.3.2 Pre-declared identifiers
    • 2.4 Keywords
    • 2.5 package
    • 2.6 import
      • 2.6.1 Aliasing of imports
      • 2.6.2 Removing explicit package reference
    • 2.7 functions
    • 2.8 String literal
    • 2.9 Numbers
      • 2.9.1 Integers
      • 2.9.2 Floating Point Numbers
      • 2.9.3 Some default values
    • 2.10 Console output
      • 2.10.1 Print and Println
      • 2.10.2 Formatting using Printf
    • 2.11 Console input
    • 2.12 Command-line arguments - Args
    • 2.13 Solutions
  • 3. Variables, Constants, and Types
    • 3.1 Variable
    • 3.2 Constants
      • 3.2.1 Typed and Untyped constants
    • 3.3 Named types
    • 3.4 Boolean types
    • 3.5 Operators
      • 3.5.1 Boolean Operators
      • 3.5.2 Arithmetic Operators
      • 3.5.3 Bitwise Operators
    • 3.6 Solutions
  • 4. Control Structures
    • 4.1 if-else
    • 4.2 goto statement
    • 4.3 switch
      • 4.3.1 fallthrough statement
    • 4.4 for loop
    • 4.5 Solutions
  • 5. Pointers
    • 5.1 Solutions
  • 6. More on Functions
    • 6.1 A function can have multiple return values. Some examples:
    • 6.2 A function can take zero or more arguments
    • 6.3 Named return values
    • 6.4 What’s the idiomatic way to exit a program with some error code?
    • 6.5 Variadic Functions
    • 6.6 Closures
    • 6.7 Recursion
    • 6.8 Solutions
  • 7. Detailed information
    • 7.1 Semicolons
    • 7.2 init
    • 7.3 Formatting
    • 7.4 More on Strings
      • 7.4.1 String functions
    • 7.5 defer
    • 7.6 Using the log package
    • 7.7 Using the big package
    • 7.8 go vet
    • 7.9 golint
    • 7.10 goimports
    • 7.11 Naming Convention Summary
  • 8. Arrays
  • 9. Slices
    • 9.1 Slice Functions
    • 9.2 Slice internals
    • 9.3 Passing a slice to a function
  • 10. Range
    • 10.1 Variadic Functions using range
  • 11. Maps
  • 12. Structs
    • 12.1 What’s the difference between pointer and non-pointer method receivers?
    • 12.2 Solutions
  • 13. interface
    • 13.1 The interface{} type
    • 13.2 Solutions
  • 14. Error
  • 15. io, os and net/http - Getting started
    • 15.1 io
    • 15.2 os
    • 15.3 TCP and net/http
      • 15.3.1 Basic Networking
      • 15.3.2 Port
      • 15.3.3 Internet Addresses
      • 15.3.4 net/http
  • 16. Random Numbers
  • 17. File Handling
    • 17.1 Package ioutil
    • 17.2 Package os
      • 17.2.1 read_file_os1.go
      • 17.2.2 read_file_os2.go
      • 17.2.3 write_file_os.go
      • 17.2.4 read_dir_os.go
    • 17.3 Package bufio
      • 17.3.1 NewReader
      • 17.3.2 Peek
      • 17.3.3 NewWriter
    • 17.4 Solutions
  • 18. JSON and Go
    • 18.1 JSON
    • 18.2 Package json
      • 18.2.1 Encoding
      • 18.2.2 Struct tags
      • 18.2.3 Decoding
      • 18.2.4 Streaming Encoders and Decoders
    • 18.3 A Fun, Weather Forecast Go Web App
      • 18.3.1 Register for an account at Forecast for Developers
  • 19. TCP programming using Go
    • 19.1 TCP Sockets
    • 19.2 Package net
      • 19.2.1 TCP Client
      • 19.2.2 A Daytime server
  • 20. Unit testing and Benchmarking Go programs
    • 20.1 Testing
    • 20.2 Benchmarks
  • 21. Concurrency
    • 21.1 Goroutines
    • 21.2 Channels
      • 21.2.1 Channel direction
      • 21.2.2 Unbuffered channel
  • 22. Additional Exercises
    • 22.1 Solutions
  • 23. Additional Reading
    • 23.1 Testable Examples in Go
  • Appendix A
    • Downloading Go
    • Install the Go tools
      • Test your installation
    • Go Code Organization
      • Workspaces
      • The GOPATH environment variable
      • Package paths
      • Editing a Go program
      • A Go program
  • Appendix B - Project: redditnews for Baby Gophers
    • Use GitHub
      • Create an account
    • Set up Git
    • Complete Appendix A
    • redditnews.go (First Iteration)
  • Appendix C - Build, deploy webapps to cloud
    • Complete Appendix A
    • A basic Go web app
    • Static Sites with Go
    • Deploying Go Web Apps to Heroku
    • Cloud Computing Service Levels
      • SaaS
      • IaaS
      • PaaS
    • Program webapp_h.go
    • Create an account on Heroku
    • Install the Heroku Toolbelt
    • Create a Procfile
    • Use Git
    • Install Godep
    • Heroku deploy
    • A brief note on Heroku
      • Troubleshooting
      • Heroku’s Architecture
      • Slugs
    • License

Authors have earned$9,661,401writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub