File tree 2 files changed +23
-5
lines changed
2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1
1
package module7
2
2
3
- //go:generate goimports -w module7_code.go
3
+ //go:generate echo "command and arguments"
Original file line number Diff line number Diff line change @@ -9,15 +9,33 @@ To test this module locally:
9
9
* Run command ` go test -run Module7 ` to run all tests for module 7, or
10
10
* Run command ` go test -v -run Module7 ` to run all tests for module 7 with verbose information
11
11
12
- ## Task 1
12
+ ## Task 1: Get help for ` go generate `
13
+ The command to get more information on ` go generate ` is ` go help generate `
13
14
15
+ In a nutshell, ` go generate ` scans the files for lines like the following (called ` directive ` ), and execute those commands:
16
+ ```
17
+ //go:generate command <argument...>
18
+ ```
14
19
20
+ Note that ` go generate ` must be run explicitly.
21
+
22
+
23
+ ## Task 2: Fill in the directive
24
+ First, check the content of the provided ` module7.go ` file.
25
+
26
+ Then, in the terminal, run ` go generate ` and examine the output.
27
+ Note that the ` echo ` command is executed.
28
+
29
+ Third, check the content of the provided ` module7_code.go ` file.
30
+ Note the ` fmt ` and ` runtime ` packages are missing.
31
+
32
+ Your task is to fill in the directive to import the missing packages.
33
+ You need to replace the whole ` echo "command and arguments" ` part with proper command.
34
+
35
+ ## Task 3
15
36
16
- ## Task 2
17
37
18
38
19
39
20
40
## Extra help
21
- Here is the command to get more information on ` go generate ` :
22
- - ` go help generate `
23
41
You can’t perform that action at this time.
0 commit comments