Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Go Programming - From Beginner to Professional
  • Table Of Contents Toc
Go Programming - From Beginner to Professional

Go Programming - From Beginner to Professional - Second Edition

By : Samantha Coyle
4.5 (13)
close
close
Go Programming - From Beginner to Professional

Go Programming - From Beginner to Professional

4.5 (13)
By: Samantha Coyle

Overview of this book

Go Programming – From Beginner to Professional is a comprehensive guide that takes your proficiency in the Go programming language from novice to expert. Starting with fundamental concepts, this book covers variables, command-line tools, and working with data before delving into advanced concepts, including error handling, interfaces, and generics, harnessing Go’s latest features through hands-on exercises. Along the way, you’ll learn to structure projects using Go modules, manage packages effectively, and master debugging techniques. As you progress, you’ll get to grips with practical application-centric aspects such as command-line programming, file manipulation, and working with SQL databases. Additionally, the book explores web server development, RESTful APIs, and utilizing the Go HTTP client to interact with web applications. Further enhancing your Go skills, you’ll learn concurrent programming, testing methodologies, Go tools, and how to deploy applications in the cloud. Throughout the book, you’ll uncover Go’s hidden gems and gain insights into time manipulation, best practices, and more. By the end of this book, you’ll have worked through practical exercises and activities that’ll equip you with the knowledge and skills needed to excel as a proficient Go developer, primed for success in real-world projects.
Table of Contents (30 chapters)
close
close
1
Part 1: Scripts
6
Part 2: Components
11
Part 3: Modules
16
Part 4: Applications
20
Part 5: Building For The Web
23
Part 6: Professional

The init() function

As we have discussed, every Go program (executable) starts in the main package and the entry point is the main() function. There is another special function that we should be aware of, called init(). Each source file can have an init() function, but for now, we will look at the init() function in the context of the main package. When you start writing packages, you might need to provide some initialization (the init() function) for the package. The init() function is used to set up states or values. The init() function adds initialization logic for your package. Here are some examples of uses of the init() function:

  • Setting database objects and connections
  • The initialization of package variables
  • Creating files
  • Loading configuration data
  • Verifying or repairing the program state

The init() function requires the following:

  • Imported packages are initialized first
  • Package-level variables are initialized
  • The package’...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Go Programming - From Beginner to Professional
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon