Skip to content

Commit d537b84

Browse files
committed
apply go fmt
1 parent 47aaa7e commit d537b84

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

cmd_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ package notes
22

33
import (
44
"fmt"
5+
"os"
6+
"path/filepath"
7+
"strings"
8+
"testing"
9+
510
"github.com/blang/semver"
611
"github.com/fatih/color"
712
"github.com/google/go-cmp/cmp"
813
"github.com/google/go-cmp/cmp/cmpopts"
914
"github.com/rhysd/go-fakeio"
1015
"github.com/rhysd/go-tmpenv"
11-
"os"
12-
"path/filepath"
13-
"strings"
14-
"testing"
1516
)
1617

1718
func TestVersion(t *testing.T) {
@@ -186,6 +187,9 @@ func TestParseExternalCommand(t *testing.T) {
186187

187188
panicIfErr(os.Setenv("PATH", os.Getenv("PATH")+string(os.PathListSeparator)+bindir))
188189

190+
exe, err := os.Executable()
191+
panicIfErr(err)
192+
189193
for _, tc := range []struct {
190194
what string
191195
args []string
@@ -232,7 +236,7 @@ func TestParseExternalCommand(t *testing.T) {
232236
t.Fatal("Output to stderr is unexpected:", output)
233237
}
234238

235-
want := fmt.Sprintln(append([]string{os.Args[0]}, tc.args...))
239+
want := fmt.Sprintln(append([]string{exe}, tc.args...))
236240
if !strings.Contains(output, want) {
237241
t.Fatal("Passed arguments to external command is unexpected. Wanted", want, "in output but have output", output)
238242
}

doc.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,5 @@ It consists structs which represent each subcommands.
4444
For usage of `notes` command, please read README of the repository.
4545
4646
https://github.com/rhysd/notes-cli/blob/master/README.md
47-
4847
*/
4948
package notes

example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !windows
12
// +build !windows
23

34
package notes_test

filepath_darwin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build darwin
12
// +build darwin
23

34
package notes

filepath_darwin_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build darwin
12
// +build darwin
23

34
package notes

filepath_other.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !darwin
12
// +build !darwin
23

34
package notes

0 commit comments

Comments
 (0)