juzhiyuan commented on a change in pull request #655:
URL: https://github.com/apache/apisix-dashboard/pull/655#discussion_r515855327



##########
File path: .github/workflows/golang-lint.yml
##########
@@ -0,0 +1,16 @@
+name: golang-lint
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master

Review comment:
       Have run on 2.0 branch?

##########
File path: .github/workflows/golang-lint.yml
##########
@@ -0,0 +1,16 @@
+name: golang-lint
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master
+jobs:

Review comment:
       extra line is needed

##########
File path: api/internal/handler/upstream/upstream_test.go
##########
@@ -46,52 +46,53 @@ func TestUpstream(t *testing.T) {
        ctx := droplet.NewContext()
        upstream := &entity.Upstream{}
        reqBody := `{
-    "id": "1",
-    "name": "upstream3",
-    "description": "upstream upstream",
-    "type": "roundrobin",
-    "nodes": [{
-              "host": "a.a.com",
-              "port": 80,
-              "weight": 1
-          }],
-    "timeout":{
-      "connect":15,
-          "send":15,
-          "read":15
-    },
-    "enable_websocket": true,
-      "hash_on": "header",
-      "key": "server_addr",
-      "checks": {
-          "active": {
-              "timeout": 5,
-              "http_path": "/status",
-              "host": "foo.com",
-              "healthy": {
-                  "interval": 2,
-                  "successes": 1
-              },
-              "unhealthy": {
-                  "interval": 1,
-                  "http_failures": 2
-              },
-              "req_headers": ["User-Agent: curl/7.29.0"]
-          },
-          "passive": {
-              "healthy": {
-                  "http_statuses": [200, 201],
-                  "successes": 3
-              },
-              "unhealthy": {
-                  "http_statuses": [500],
-                  "http_failures": 3,
-                  "tcp_failures": 3
-              }
-          }
-      }
-  }`
-       json.Unmarshal([]byte(reqBody), upstream)
+               "id": "1",
+               "name": "upstream3",
+               "description": "upstream upstream",
+               "type": "roundrobin",
+               "nodes": [{
+                         "host": "a.a.com",
+                         "port": 80,
+                         "weight": 1
+                     }],
+               "timeout":{
+                 "connect":15,
+                     "send":15,
+                     "read":15
+               },
+               "enable_websocket": true,
+                 "hash_on": "header",
+                 "key": "server_addr",
+                 "checks": {
+                     "active": {
+                         "timeout": 5,
+                         "http_path": "/status",
+                         "host": "foo.com",
+                         "healthy": {
+                             "interval": 2,
+                             "successes": 1
+                         },
+                         "unhealthy": {
+                             "interval": 1,
+                             "http_failures": 2
+                         },
+                         "req_headers": ["User-Agent: curl/7.29.0"]
+                     },
+                     "passive": {
+                         "healthy": {
+                             "http_statuses": [200, 201],
+                             "successes": 3
+                         },
+                         "unhealthy": {
+                             "http_statuses": [500],
+                             "http_failures": 3,
+                             "tcp_failures": 3
+                         }
+                     }
+                 }

Review comment:
       
![image](https://user-images.githubusercontent.com/2106987/97854631-b2311c80-1d34-11eb-861e-42a50d19dd48.png)
   
   What happened here?

##########
File path: api/conf/conf.go
##########
@@ -36,8 +36,8 @@ const (
        EnvDEV   = "dev"
        EnvLOCAL = "local"
 
-       confPath   = "/go/manager-api/conf.json"
-       schemaPath = "/go/manager-api/schema.json"
+       confJsonPath = "/go/manager-api/conf.json"

Review comment:
       No, could be overridden by conf file.

##########
File path: api/conf/conf.go
##########
@@ -36,8 +36,8 @@ const (
        EnvDEV   = "dev"
        EnvLOCAL = "local"
 
-       confPath   = "/go/manager-api/conf.json"
-       schemaPath = "/go/manager-api/schema.json"
+       confJsonPath = "/go/manager-api/conf.json"

Review comment:
       Sorry for my typo, this path would be overridden by ENV.
   
   
https://github.com/nic-chen/incubator-apisix-dashboard/blob/go-lint/docs/deploy.md#note
   
   
![image](https://user-images.githubusercontent.com/2106987/97855550-d9d4b480-1d35-11eb-8451-47f9f9caee05.png)

##########
File path: api/conf/conf.go
##########
@@ -36,8 +36,8 @@ const (
        EnvDEV   = "dev"
        EnvLOCAL = "local"
 
-       confPath   = "/go/manager-api/conf.json"
-       schemaPath = "/go/manager-api/schema.json"
+       confJsonPath = "/go/manager-api/conf.json"

Review comment:
       And @nic-chen  will resolve this in the future for easy to use

##########
File path: .github/workflows/golang-lint.yml
##########
@@ -0,0 +1,19 @@
+name: golang-lint
+on:
+  push:
+    branches:
+      - master

Review comment:
       trigger 2.0




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to