fix: grammar mistakes
This commit is contained in:
committed by
Inanc Gumus
parent
9806e01284
commit
06891c57fc
@ -14,7 +14,7 @@
|
||||
|
||||
## 3. Install Go
|
||||
|
||||
Select linux and the download will begin.
|
||||
Select Linux and the download will begin.
|
||||
|
||||
```bash
|
||||
firefox https://golang.org/dl
|
||||
@ -47,7 +47,7 @@ Select linux and the download will begin.
|
||||
|
||||
* These are very handy tools to ease the development (like goimports)
|
||||
|
||||
* `go get` cannot be usable without installing a code versioning program like Git which we already have got it above.
|
||||
* `go get` cannot be used without installing a code versioning program like Git which we already have got it above.
|
||||
|
||||
* This will create `~/go` directory and will download go tools into there.
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
* In this course I'll be using bash commands. Bash is just a command-line interface used in OS X and Linux. It's one of the most popular command-line interfaces. So, if you want to use it too, instead of using the Windows default command-line, you can use git bash that you've installed. With git bash, you can type a command in command-line as you're on OS X or Linux.
|
||||
|
||||
* If you don't want to use git bash, it's ok too. It depends on you. But note that, I'll be using bash commands mostly. Because, it allows more advanced commands as well.
|
||||
* If you don't want to use git bash, it's ok too. It depends on you. But note that, I'll be using bash commands mostly. Because it allows more advanced commands as well.
|
||||
|
||||
* You can also prefer to use the more powerful alternative to git bash: [Linux Subsystem for Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
1. Just search for git bash from the start bar
|
||||
2. Or, if there's one, click on the icon on your desktop
|
||||
|
||||
3. Also setup VS Code to use git-bash by default:
|
||||
3. Also, setup VS Code to use git-bash by default:
|
||||
1. Open VS Code
|
||||
2. Go to Command Palette
|
||||
1. Type: `terminal`
|
||||
|
@ -67,7 +67,7 @@ _See the next page..._
|
||||
|
||||
* **Example:**
|
||||
|
||||
* My github username is: inancgumus
|
||||
* My GitHub username is: inancgumus
|
||||
|
||||
* So, I put all my programs under: `~/go/src/github.com/inancgumus/`
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE: Print GOPATH
|
||||
//
|
||||
// Print your GOPATH using `go env` tool
|
||||
// Print your GOPATH using the `go env` tool
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// The physical folder path that is referenced by $GOPATH
|
||||
|
@ -28,7 +28,7 @@
|
||||
**You can find the full list in here:**
|
||||
https://golang.org/doc/install/source#environment
|
||||
|
||||
**NOTE:** If you're using the command prompt or the powershell, you may need to use it like this:
|
||||
**NOTE:** If you're using the command prompt or the PowerShell, you may need to use it like this:
|
||||
`cmd /c "set GOOS=darwin GOARCH=386 && go build"`
|
||||
|
||||
4. **Call [Print](https://golang.org/pkg/fmt/#Print) instead of [Println](https://golang.org/pkg/fmt/#Println)** to see what happens.
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
2. Look at their source-code by clicking on their titles.
|
||||
|
||||
3. You don't have to understand everything, just do it.This will warm you up for the upcoming lectures.
|
||||
3. You don't have to understand everything, just do it. This will warm you up for the upcoming lectures.
|
||||
|
||||
9. Also, **take a tour on**: https://tour.golang.org/
|
||||
|
||||
|
@ -32,12 +32,12 @@
|
||||
|
||||
|
||||
## Which one below is true for runtime?
|
||||
1. It happens when your program starts running in a computer *CORRECT*
|
||||
1. It happens when your program starts running on a computer *CORRECT*
|
||||
2. It happens while your program is being compiled
|
||||
|
||||
|
||||
## Which one below is true for the compile-time?
|
||||
1. It happens when your program starts running in a computer
|
||||
1. It happens when your program starts running on a computer
|
||||
2. It happens while your program is being compiled *CORRECT*
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ func main() {
|
||||
|
||||
// Here, `main()` can access `bye()` and `hey()`
|
||||
|
||||
// It's because: bye.go, hey.go and main.go
|
||||
// It's because bye.go, hey.go and main.go
|
||||
// are in the main package.
|
||||
|
||||
bye()
|
||||
|
@ -11,7 +11,7 @@ package main
|
||||
// (Just remove the // characters for all 3 lines below)
|
||||
|
||||
// This file cannot see main.go's imported names ("fmt").
|
||||
// Because, the imported names belong to file scope.
|
||||
// Because the imported names belong to file scope.
|
||||
|
||||
// func bye() {
|
||||
// fmt.Println("Bye!")
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
## Why a package clause is used in a Go source-code file?
|
||||
1. It's used for importing a package
|
||||
2. It's used for letting Go know that the file belong to a package *CORRECT*
|
||||
2. It's used for letting Go know that the file belongs to a package *CORRECT*
|
||||
3. It's used for declaring a new function
|
||||
|
||||
> **1:** `import` statement does that.
|
||||
|
@ -67,7 +67,7 @@ func block() {
|
||||
3. No: It's in the file scope
|
||||
4. No: It's in the block scope of block() **CORRECT**
|
||||
|
||||
> **4:** That's right. None of the other code can see the names inside the `block()` function. Only the code inside the `block()` function can see them (Only to some extend. For example: Inside the block, the code can only see the variables declared before it.)
|
||||
> **4:** That's right. None of the other code can see the names inside the `block()` function. Only the code inside the `block()` function can see them (Only to some extent. For example: Inside the block, the code can only see the variables declared before it.)
|
||||
>
|
||||
>
|
||||
|
||||
@ -83,7 +83,7 @@ func block() {
|
||||
>
|
||||
|
||||
|
||||
## What happens if you declare the same name in the same scope like this:
|
||||
## What happens if you declare the same name in the same scope as this:
|
||||
```go
|
||||
package awesome
|
||||
|
||||
|
@ -13,8 +13,8 @@ import "fmt"
|
||||
/*
|
||||
main function
|
||||
Go executes this program using this function.
|
||||
There should be only one main file in a main package.
|
||||
Executable programs are also called as "commands".
|
||||
There should be only one main file in the main package.
|
||||
Executable programs are also called "commands".
|
||||
*/
|
||||
func main() {
|
||||
fmt.Println("Hello Gopher!")
|
||||
|
@ -3,7 +3,7 @@
|
||||
2. A statement produces a value
|
||||
3. A statement can't change the execution flow
|
||||
|
||||
> **2:** A statement can't produce a value. However, it can indirectly help producing a value.
|
||||
> **2:** A statement can't produce a value. However, it can indirectly help to produce a value.
|
||||
>
|
||||
>
|
||||
> **3:** It surely can.
|
||||
|
@ -50,7 +50,7 @@ func main() {
|
||||
>
|
||||
|
||||
## How should you name your code so that Go can generate documentation from your code automatically?
|
||||
1. By commenting the each line of the code; then it will generate the documentation from whatever it sees
|
||||
1. By commenting each line of the code; then it will generate the documentation from whatever it sees
|
||||
2. By starting the comments using the name of the declared names *CORRECT*
|
||||
3. By using multi-line comments
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
# EXERCISE
|
||||
1. Create a new library
|
||||
2. In it, create a function that returns Go version
|
||||
2. In it, create a function that returns the Go version
|
||||
3. Create a command and import your library
|
||||
4. Call your function that returns Go version
|
||||
5. Run your program
|
||||
@ -23,8 +23,8 @@ It should print the current Go version on your system.
|
||||
|
||||
## WARNING
|
||||
|
||||
You should create this package under your own folder, not in github.com/inancgumus/learngo folder. Also, please note that, VS Code may automatically import my library which is in github.com/inancgumus/learngo instead of your own library.
|
||||
You should create this package under your own folder, not in github.com/inancgumus/learngo folder. Also, please note that VS Code may automatically import my library which is in github.com/inancgumus/learngo instead of your own library.
|
||||
|
||||
So, if you want VS Code automatically import your own package when you save, just move github.com/inancgumus/learngo out of GOPATH to somewhere else, for example, to your Desktop (of course move it back afterwards).
|
||||
So, if you want VS Code automatically import your own package when you save, just move github.com/inancgumus/learngo out of GOPATH to somewhere else, for example, to your Desktop (of course move it back afterward).
|
||||
|
||||
See [this question](https://www.udemy.com/learn-go-the-complete-bootcamp-course-golang/learn/v4/questions/5518190) in Q&A for more information.
|
@ -2,13 +2,13 @@
|
||||
**NOTE** _There are explanations inside the answers. Even if you know the answer please try to select all of them one by one, so you can read the explanations._
|
||||
|
||||
1. You can run a library package.
|
||||
2. In a library package there should be a function named main (func main).
|
||||
2. In a library package, there should be a function named main (func main).
|
||||
3. You can compile a library package. *CORRECT*
|
||||
4. You have to compile a library package.
|
||||
|
||||
> **1:** You can't, but you can import it from other packages.
|
||||
>
|
||||
> **2:** In a library package, you don't have to include a main function. Because, it isn't an executable package. Only in executable packages you need a main func.
|
||||
> **2:** In a library package, you don't have to include the main function. Because it isn't an executable package. Only in executable packages you need a main func.
|
||||
>
|
||||
> **4:** You don't have to compile it. When you import it, it will automatically be built by the other program or library when it gets compiled or ran.
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
|
||||
|
||||
## How can you use a function from your library from an executable program?
|
||||
1. You need to export your library package first; then you can access to its imported names
|
||||
2. You need to import your library package first; then you can access to its exported names *CORRECT*
|
||||
1. You need to export your library package first; then you can access its imported names
|
||||
2. You need to import your library package first; then you can access its exported names *CORRECT*
|
||||
3. You can access your library package as if it's in your executable program
|
||||
4. You can import it just by using its name
|
||||
|
||||
@ -38,9 +38,9 @@
|
||||
>
|
||||
> **2:** That's right.
|
||||
>
|
||||
> **3:** You can't access to a package from another package without importing it.
|
||||
> **3:** You can't access a package from another package without importing it.
|
||||
>
|
||||
> **4:** No, you can't. You need to import it using its full directory path after GOPATH. BTW, in the near future this may change with the Go modules support.
|
||||
> **4:** No, you can't. You need to import it using its full directory path after GOPATH. BTW, in the near future, this may change with the Go modules support.
|
||||
|
||||
|
||||
## In the following program, which names are exported?
|
||||
|
@ -4,4 +4,4 @@
|
||||
|
||||
2. **[Print hexes](https://github.com/inancgumus/learngo/tree/master/06-variables/01-basic-data-types/exercises/02-print-hexes)** (optional exercise)
|
||||
|
||||
Print numbers in hexadecimals
|
||||
Print numbers in hexadecimal
|
||||
|
@ -17,7 +17,7 @@ func main() {
|
||||
// underscore is allowed but not recommended
|
||||
var _speed int
|
||||
|
||||
// unicode letters are allowed
|
||||
// Unicode letters are allowed
|
||||
var 速度 int
|
||||
|
||||
// keep the compiler happy
|
||||
|
@ -19,7 +19,7 @@ import "fmt"
|
||||
// safe := true
|
||||
|
||||
// However, you can use the normal declaration at the
|
||||
// package scope. Since, it has a keyword: `var`
|
||||
// package scope. Since it has a keyword: `var`
|
||||
var safe = true
|
||||
|
||||
func main() {
|
||||
|
@ -94,7 +94,7 @@ x, z := 10, "hi"
|
||||
* 20
|
||||
* false
|
||||
|
||||
## Which following declaration can be used in the package scope?
|
||||
## Which of the following declaration can be used in the package scope?
|
||||
|
||||
* x := 10
|
||||
* y, x := 10, 5
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Assignments
|
||||
|
||||
Assignment means "copying" values. Everything is get copied in Go. You'll learn more about this afterwards.
|
||||
Assignment means "copying" values. Everything is getting copied in Go. You'll learn more about this afterward.
|
||||
|
||||
Now, get your feet wet and try some assignment exercises.
|
||||
|
||||
|
@ -10,7 +10,7 @@ package main
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// I'm using multiple declaration instead of singular
|
||||
// I'm using multiple declarations instead of singular
|
||||
var (
|
||||
speed int
|
||||
heat float64
|
||||
|
15
README.md
15
README.md
@ -1,5 +1,5 @@
|
||||
# Learn Go Programming: Complete Bootcamp Course (Golang)
|
||||
This repository contains the examples, exercises and quizzes for the course.
|
||||
This repository contains the examples, exercises, and quizzes for the course.
|
||||
|
||||
**Get it now for 80% off with the link: https://www.udemy.com/learn-go-the-complete-bootcamp-course-golang/?couponCode=FROM-GITHUB**
|
||||
|
||||
@ -7,15 +7,15 @@ This repository contains the examples, exercises and quizzes for the course.
|
||||
|
||||
# Stay in touch
|
||||
|
||||
[Follow me on twitter](https://twitter.com/inancgumus)
|
||||
[Follow me on Twitter](https://twitter.com/inancgumus)
|
||||
|
||||
[](https://twitter.com/inancgumus)
|
||||
|
||||
👉 [Subscribe to my Go emailing list](http://eepurl.com/c4DMNX)
|
||||
👉 [Subscribe to my Go emailing list](https://eepurl.com/c4DMNX)
|
||||
|
||||
_(5K+ developers already subscribed!)_
|
||||
|
||||
👉 [Learn Go Programming Blog](http://blog.learngoprogramming.com)
|
||||
👉 [Learn Go Programming Blog](https://blog.learngoprogramming.com)
|
||||
|
||||
_(Followed by 3K+ developers)_
|
||||
|
||||
@ -23,10 +23,11 @@ This repository contains the examples, exercises and quizzes for the course.
|
||||
|
||||
_(For 4K Videos — The channel is very young right now)_
|
||||
|
||||
👉 [Learn Go Programming Facebook Group](https://www.facebook.com/learngoprogramming/)
|
||||
👉 [Learn Go Programming Facebook Page](https://www.facebook.com/learngoprogramming/)
|
||||
|
||||
👉 [Learn Go Programming Facebook Group](https://www.facebook.com/groups/learngoprogramming/)
|
||||
---
|
||||
|
||||
## License
|
||||
Whole materials are licensed under the <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.<br/>
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"/></a>
|
||||
Whole materials are licensed under the <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.<br/>
|
||||
<a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"/></a>
|
||||
|
@ -4,15 +4,15 @@ Hi!
|
||||
|
||||
If you're an experienced developer, you might want to follow this roadmap while taking this course.
|
||||
|
||||
This course starts from the most basics than advances toward the end, step by step. So, the complexity of the topics increase on each step. I've intentionally designed it so to make it easy for everyone.
|
||||
This course starts from the most basics than advances toward the end, step by step. So, the complexity of the topics increases on each step. I've intentionally designed it so to make it easy for everyone.
|
||||
|
||||
If you think some of the topics are easy for you, then just watch the recap lectures and skip the lectures in that section all together, you can always come back to them later.
|
||||
If you think some of the topics are easy for you, then just watch the recap lectures and skip the lectures in that section altogether, you can always come back to them later.
|
||||
|
||||
1. **Git clone the repo**
|
||||
https://github.com/inancgumus/learngo
|
||||
|
||||
2. Read **"Experimental: Using Go Modules"** document and you won't have to use GOPATH
|
||||
1. If you want learn about GOPATH, just watch:
|
||||
1. If you want to learn about GOPATH, just watch:
|
||||
2. Learn about GOPATH and Go directory structure
|
||||
|
||||
3. You might want to increase the video speed.
|
||||
@ -37,7 +37,7 @@ If you think some of the topics are easy for you, then just watch the recap lect
|
||||
* Importing and File Scope
|
||||
* Importing - Rename imported packages
|
||||
|
||||
## PART I — Statements, Expressions and Comments
|
||||
## PART I — Statements, Expressions, and Comments
|
||||
* Go Doc: Generate documentation automatically from your code
|
||||
|
||||
## PART I — Create Your First Library Package
|
||||
|
@ -13,7 +13,7 @@ import "fmt"
|
||||
/*
|
||||
main function
|
||||
Go executes this program using this function.
|
||||
There should be only one main file in a main package.
|
||||
There should be only one main file in the main package.
|
||||
Executable programs are also called as "commands".
|
||||
*/
|
||||
func main() {
|
||||
|
@ -17,7 +17,7 @@ func main() {
|
||||
|
||||
// Here, `main()` can access `bye()` and `hey()`
|
||||
|
||||
// It's because: bye.go, hey.go and main.go
|
||||
// It's because bye.go, hey.go and main.go
|
||||
// are in the main package.
|
||||
|
||||
bye()
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print your GOPATH using `go env` tool
|
||||
// Print your GOPATH using the `go env` tool
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// The physical folder path that is referenced by $GOPATH
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
## Which one below is true for runtime?
|
||||
1. It happens when your program starts running in a computer *CORRECT*
|
||||
1. It happens when your program starts running on a computer *CORRECT*
|
||||
2. It happens while your program is being compiled
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user