You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: task/module3.md
+12-9
Original file line number
Diff line number
Diff line change
@@ -10,27 +10,30 @@ To test this module locally:
10
10
* Run command `go test -run Module3` to run all tests for module 3, or
11
11
* Run command `go test -v -run Module3` to run all tests for module 3 with verbose information
12
12
13
-
## Task 1
14
-
To add dependencies to current module and install the packages, we use the [`go get` command](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them).
13
+
## Task 1: Get help information for `go get`
14
+
The [`go get` command](https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) will be used to download and install packages.
15
15
The syntax can be as simple as this:
16
16
```
17
17
go get <package>
18
18
```
19
19
20
20
The above `package` can be the git repo of the package if hosted on github (that is, without the `https://` prefix).
21
21
22
+
To get more information, check the output of `go help get`.
23
+
24
+
To list all packages in the module, you can use `go list -m all`.
25
+
Help on `list` can be found at `go help list`
26
+
27
+
28
+
## Task 2: Use `go get` to install a package
29
+
To add dependencies to current module and install the packages, we use the `go get` command.
30
+
22
31
Your task is to write a command to import the following package which can be used to retrieve the sunrise and sunset time given a location and a date. Here is the github repo:
23
32
```
24
33
https://github.com/nathan-osman/go-sunrise
25
34
```
26
35
27
-
In the terminal, type in the command to import the above package.
28
-
36
+
In the terminal, type in the complete command to import the above package.
29
37
30
38
31
-
## Extra help
32
-
Here is the command to get more information on `go get`:
33
-
-`go help get`
34
39
35
-
To list all packages in the module, you can use `go list -m all`. Help on `list` can be found at:
Copy file name to clipboardExpand all lines: task/module4.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -10,26 +10,26 @@ To test this module locally:
10
10
* Run command `go test -run Module4` to run all tests for module 4, or
11
11
* Run command `go test -v -run Module4` to run all tests for module 4 with verbose information
12
12
13
-
## Task 1
13
+
## Task 1: Get help information of `go install`
14
14
To compiles and installs the dependency packages, we use the [`go install` command](https://golang.org/cmd/go/#hdr-Compile_and_install_packages_and_dependencies).
15
+
15
16
The syntax can be as simple as this:
16
17
```
17
18
go install <package>
18
19
```
19
20
20
21
Same as `go get`, the above `package` can be the git repo of the package if hosted on github (that is, without the `https://` prefix).
21
22
23
+
To get more information on `go install`, check the output of `go help install`
24
+
25
+
To get more information about the build flags, check the output of `go help build`
26
+
27
+
28
+
## Task 2: Use `go install` to compile and install a package
22
29
Your task is to write a command to import the following package which can be used to provide common case conversion functions.
23
30
Here is the `go.dev` link: (Note: you need to read and find out the value for `<package>`)
0 commit comments