From b295f11ae99213ac0909cbd34a44b60c709cf0d3 Mon Sep 17 00:00:00 2001 From: Inanc Gumus Date: Mon, 22 Oct 2018 21:15:08 +0300 Subject: [PATCH] refactor: organize exercises and questions for the 5th section --- .../exercise.md => exercise/README.md} | 0 .../solution/golang/cmd/main.go | 0 .../solution/golang/go.go | 0 .../questions.md | 26 +------------------ 4 files changed, 1 insertion(+), 25 deletions(-) rename 05-write-your-first-library-package/{printer-exercise/exercise.md => exercise/README.md} (100%) rename 05-write-your-first-library-package/{printer-exercise => exercise}/solution/golang/cmd/main.go (100%) rename 05-write-your-first-library-package/{printer-exercise => exercise}/solution/golang/go.go (100%) rename 05-write-your-first-library-package/{printer-exercise => questions}/questions.md (97%) diff --git a/05-write-your-first-library-package/printer-exercise/exercise.md b/05-write-your-first-library-package/exercise/README.md similarity index 100% rename from 05-write-your-first-library-package/printer-exercise/exercise.md rename to 05-write-your-first-library-package/exercise/README.md diff --git a/05-write-your-first-library-package/printer-exercise/solution/golang/cmd/main.go b/05-write-your-first-library-package/exercise/solution/golang/cmd/main.go similarity index 100% rename from 05-write-your-first-library-package/printer-exercise/solution/golang/cmd/main.go rename to 05-write-your-first-library-package/exercise/solution/golang/cmd/main.go diff --git a/05-write-your-first-library-package/printer-exercise/solution/golang/go.go b/05-write-your-first-library-package/exercise/solution/golang/go.go similarity index 100% rename from 05-write-your-first-library-package/printer-exercise/solution/golang/go.go rename to 05-write-your-first-library-package/exercise/solution/golang/go.go diff --git a/05-write-your-first-library-package/printer-exercise/questions.md b/05-write-your-first-library-package/questions/questions.md similarity index 97% rename from 05-write-your-first-library-package/printer-exercise/questions.md rename to 05-write-your-first-library-package/questions/questions.md index 1c81201..7580346 100644 --- a/05-write-your-first-library-package/printer-exercise/questions.md +++ b/05-write-your-first-library-package/questions/questions.md @@ -8,13 +8,9 @@ > **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. > -> > **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. -> -> ## What do you need to export a name? @@ -25,16 +21,11 @@ > **1:** When you do so, it will be exported, that's true, but don't do that; so I assume that this answer is not correct :) > -> > **2:** That's right. Then the other packages can access it. > -> > **3:** It should be in a package scope, not function scope. > -> > **4:** You don't have to do that. -> -> ## How can you use a function from your library from an executable program? @@ -45,16 +36,11 @@ > **1:** You can't export packages. All packages are already exported. Unless you put them in a directory called: "internal". But, that's an advanced topic for now. > -> > **2:** That's right. > -> > **3:** You can't access to 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. -> -> ## In the following program, which names are exported? @@ -79,16 +65,11 @@ func Fireball() { > **1:** That's just an imported package name. > -> > **2:** It starts with a lowercase letter; so, it's not exported. > -> > **3:** That's right. It starts with a capital letter. > -> > **4:** This isn't your function. It's already been exported in the fmt package. But, it isn't exported here. -> -> ## In the following program, which names are exported? @@ -116,13 +97,8 @@ func Fireball() { > **1:** doMagic starts with a lowercase letter; so, it's not exported. > -> > **2:** That's right. Fireball and Two, they both start with a capital letter. > -> > **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. -> -> \ No newline at end of file +> **4:** one and greenTrees do not start with capital letters; so, they're not exported. \ No newline at end of file