浏览代码

pkg/jsonmessage: format code with gofumpt

Formatting the code with https://github.com/mvdan/gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 年之前
父节点
当前提交
651086d1d9
共有 1 个文件被更改,包括 5 次插入8 次删除
  1. 5 8
      pkg/jsonmessage/jsonmessage_test.go

+ 5 - 8
pkg/jsonmessage/jsonmessage_test.go

@@ -34,7 +34,7 @@ func TestProgressString(t *testing.T) {
 		}
 	}
 
-	var testcases = []struct {
+	testcases := []struct {
 		name     string
 		progress JSONProgress
 		expected expected
@@ -220,9 +220,7 @@ func TestJSONMessageDisplayWithJSONError(t *testing.T) {
 }
 
 func TestDisplayJSONMessagesStreamInvalidJSON(t *testing.T) {
-	var (
-		inFd uintptr
-	)
+	var inFd uintptr
 	data := bytes.NewBuffer([]byte{})
 	reader := strings.NewReader("This is not a 'valid' JSON []")
 	inFd, _ = term.GetFdInfo(reader)
@@ -234,15 +232,14 @@ func TestDisplayJSONMessagesStreamInvalidJSON(t *testing.T) {
 }
 
 func TestDisplayJSONMessagesStream(t *testing.T) {
-	var (
-		inFd uintptr
-	)
+	var inFd uintptr
 
 	messages := map[string][]string{
 		// empty string
 		"": {
 			"",
-			""},
+			"",
+		},
 		// Without progress & ID
 		"{ \"status\": \"status\" }": {
 			"status\n",