fix: grammar mistakes

This commit is contained in:
Paul Waldmann
2018-11-18 05:03:43 +08:00
committed by Inanc Gumus
parent 9806e01284
commit 06891c57fc
27 changed files with 86 additions and 85 deletions

View File

@ -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.
See [this question](https://www.udemy.com/learn-go-the-complete-bootcamp-course-golang/learn/v4/questions/5518190) in Q&A for more information.

View File

@ -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?
@ -101,4 +101,4 @@ func Fireball() {
>
> **3:** greenTrees starts with a lowercase letter; so, it's not exported.
>
> **4:** one and greenTrees do not start with capital letters; so, they're not exported.
> **4:** one and greenTrees do not start with capital letters; so, they're not exported.