GithubHelp home page GithubHelp logo

softchris / golang-book Goto Github PK

View Code? Open in Web Editor NEW
158.0 5.0 28.0 1.26 MB

A book on Go, contains fundamentals but also recipes

License: MIT License

Go 100.00%
go golang golang-examples golang-application api book free json programming web

golang-book's Introduction

Go from the beginning

Welcome to Go from the beginning, a free book containing 25+ lessons that will take you from "zero to hero" in the amazing language Go.

Read online

https://softchris.github.io/golang-book/

Read offline/PDF/EPUB

https://leanpub.com/go-from-the-beginning FREE on LeanPub

Donate

Please consider donating to the people of Ukraine.

Table of content

Chapter Title Section What you will learn Lesson
01 Hello world Basics Why use Go and how to write your first program Lesson
02 Using variables Basics How to declare variables with different data types and how to initialize and assign values Lesson
03 Boolean logic with If and Else Basics How to work with boolean variables and create different execution paths with If, Else and Else If Lesson
04 Converting between strings and numbers Basics How to use the strconv library to convert between primitives and strings. Lesson
05 Loop statements Basics How to repeat statements and iterating over list structures and ways to control the loops Lesson
06 User input Basics How to read user input from the console Lesson
07 Functions Basics Reuse your code by creating functions. Learn how to deal with parameters and how to deal with returns and return types Lesson
08 Error handling Basics How manage errors in your code. This will teach both how to produce errors as well as deal with them Lesson
09 Arrays Composite data types Here we will learn about arrays, how to construct them, access items and iterate over them Lesson
10 Structs Composite data types Structs enables us to collect many fields in one grouping, learn how to create and modify structs Lesson
11 Maps Composite data types Maps make it easy to lookup items if you know the key. Maps have the notion of keys and values. Lesson
12 Interfaces Composite data types Learn how you can model your data as interfaces and how to implement them Lesson
13 Create your first project Projects Learn how to create your first project Lesson
14 Consume external packages Projects Learn how to use external packages Lesson
15 Create shared module Projects Create a module you can share with others Lesson
16 Testing Testing Learn to test your code Lesson
17 JSON Web Dev Learn to work with the JSON format Lesson
18 Build a Web App Web Dev Learn how to build a web app capable of serving many different formats Lesson
19 Logs Miscellaneous Use logging for better management of all kinds of messages in your app Lesson
20 Strings Miscellaneous Work with the string library Lesson
21 Regex Miscellaneous Work with regular epressions Lesson
22 Goroutines Miscellaneous Work with goroutines and channels Lesson
23 Database with Sqlite Miscellaneous Work with databases Lesson
24 Read and write to files IO Learn to read from and write to files Lesson
25 Files and directories IO Learn to perform operations on files and directories Lesson

How to use this content

Every chapter consist of a lesson and an exercise. You are encouraged to run the code in the exercise, modify it and understand how it works.

Contributions

Contributions are very welcome. Please raise an issue of you see something or a PR.

I welcome contributions on:

  • Suggestions on topics to cover
  • Correctness issues
  • Spelling
  • Suggestions on better formatting
  • I hope I hear from you. :)

golang-book's People

Contributors

adityavarmauddaraju avatar aliyazdani avatar elijahmanor avatar piqoni avatar softchris avatar subashkc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

golang-book's Issues

usage of undefined variable in consume external module chapter

In the chapter consume external module of online version of the book the code example has an error where the variable sum is used without definition

package main

import (
"fmt"
"github.com/softchris/math"
)

func main() {
sum += math.Add(1,2)
fmt.Println(sum)
}

the line sum += math.Add(1,2) should be replaced with sum := math.Add(1,2)

Ch2

  • Copyedit
  • Add Image header
  • ...other stuff

Ch1:Loops section continue statement is missing.

First of all great effort for this book.

In the Chapter1 Loops section under the Controlling the loop with continue and break the continue program missing the continue statement.

Expected Output:
2,3
Actual Output:
nothing

Need to Fix:
Change the break keyword instead put continue.

Thank you @softchris

Ch1

  • Copyedit
  • Add Image header
  • ...other stuff

Concurrency vs Parallelism

In the lesson on Goroutines and channels, you say:

Concurrency is the task of running and managing the multiple computations at the same time. While parallelism is the task of running multiple computations simultaneously.

You're essentially saying that concurrency and parallelism are the same, which I'm sure you know is not the case.

This Stack Overflow answer provides a concise explanation of the difference between them. Rob Pike's talks "Concurrency is not Parallelism" and "Go Concurrency Patterns" also discuss the topic further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.