Skip to content

Commit 2973615

Browse files
mehdi.cheracher@gmail.comchermehdi
authored andcommitted
fix warnings.
change command name.
1 parent 32a8c02 commit 2973615

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

commands/config_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ func getDefaultConfiguration() *config.Config {
2020
}
2121

2222
func TestSetConfiguration(t *testing.T) {
23-
config := getDefaultConfiguration()
23+
configuration := getDefaultConfiguration()
2424

25-
UpdateConfiguration(config, "server.port", "1245")
25+
_ = UpdateConfiguration(configuration, "server.port", "1245")
2626

27-
assert.Equal(t, config.Server.Port, 1245)
28-
assert.Equal(t, config.Lang.Default, "cpp")
27+
assert.Equal(t, configuration.Server.Port, 1245)
28+
assert.Equal(t, configuration.Lang.Default, "cpp")
2929

30-
UpdateConfiguration(config, "lang.default", "java")
31-
assert.Equal(t, config.Lang.Default, "java")
30+
_ = UpdateConfiguration(configuration, "lang.default", "java")
31+
assert.Equal(t, configuration.Lang.Default, "java")
3232
}
3333

3434
func TestSetConfigurationUnknownKey(t *testing.T) {
35-
config := getDefaultConfiguration()
36-
err := UpdateConfiguration(config, "unkown.key", "123")
35+
configuration := getDefaultConfiguration()
36+
err := UpdateConfiguration(configuration, "unkown.key", "123")
3737

3838
assert.Error(t, err, "Error should be returned if the key is unknown")
3939
}

commands/parse.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func waitForShutDown(server *http.Server, done chan<- string, quit <-chan string
139139
done <- content
140140
}
141141

142-
func ParseAction(context *cli.Context) error {
142+
func ParseAction(_ *cli.Context) error {
143143
msgReceiveChannel := make(chan string, 1)
144144
msgReadChannel := make(chan string, 1)
145145

@@ -188,11 +188,4 @@ var ParseCommand = cli.Command{
188188
Usage: "Parse a task using 'Competitive Companion'",
189189
UsageText: "parse task from navigator",
190190
Action: ParseAction,
191-
//Flags: []cli.Flag{
192-
// //&cli.BoolFlag{
193-
// // Name: "cd",
194-
// // Aliases: []string{"c"},
195-
// // Usage: "Change to task directory after creating the task",
196-
// //},
197-
//},
198191
}

commands/run.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type DiffChecker struct {
2020
}
2121

2222
func (c *DiffChecker) Check(got, expected string) error {
23-
// Compre the trimmed output from both input and output
23+
// Compare the trimmed output from both input and output
2424
if strings.Trim(got, " \t\n\r") != strings.Trim(expected, " \t\n\r") {
2525
return errors.New(fmt.Sprintf("Checker failed, expected %s, found %s", got, expected))
2626
}
@@ -59,8 +59,8 @@ func RunAction(context *cli.Context) error {
5959
return nil
6060
}
6161

62-
var RunCommand = cli.Command{
63-
Name: "run",
62+
var TestCommand = cli.Command{
63+
Name: "test",
6464
Aliases: []string{"r"},
6565
Usage: "Run the current task testcases",
6666
UsageText: "Run the current task testcases",

main.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func main() {
4747
&commands.ShowCasesCommand,
4848
&commands.CopyCommand,
4949
&commands.PrintCaseCommand,
50+
&commands.TestCommand,
5051
},
5152
}
5253

0 commit comments

Comments
 (0)