diff --git a/cli/cli_test.go b/cli/cli_test.go index df6c6ec4d09668c3cf7996599a03bf129441ccf4..65bf6e6497dd747d4cbd951143cf4c56e2b46ea4 100644 --- a/cli/cli_test.go +++ b/cli/cli_test.go @@ -69,8 +69,8 @@ func TestHttpGet(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if err := HttpGet(tt.args.apiEndpoint, tt.args.f, tt.args.args...); (err != nil) != tt.wantErr { - t.Errorf("HttpGet() error = %v, wantErr %v", err, tt.wantErr) + if err := HTTPGet(tt.args.apiEndpoint, tt.args.f, tt.args.args...); (err != nil) != tt.wantErr { + t.Errorf("HTTPGet() error = %v, wantErr %v", err, tt.wantErr) } }) } diff --git a/cli/http.go b/cli/http.go index 5c1e9e2e2d7086c23c9c42af330ca979152e2f2d..ba3b2f6765f1a5a5f2adc5137533e2cb95a420eb 100644 --- a/cli/http.go +++ b/cli/http.go @@ -17,7 +17,7 @@ func init() { builder = &strings.Builder{} } -func HttpGet(apiEndpoint, f string, args ...string) error { +func HTTPGet(apiEndpoint, f string, args ...string) error { for _, p := range args { builder.WriteString("&") builder.WriteString(p) diff --git a/cmd/addDevice.go b/cmd/addDevice.go index 66b68e55bc4b103ff1e823fc11fe305a0f725f84..3b98c03b9ba3af1a506672c5d5f3227e83535823 100644 --- a/cmd/addDevice.go +++ b/cmd/addDevice.go @@ -42,7 +42,7 @@ var addDeviceCmd = &cobra.Command{ Short: "adds a device to the controller", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet( + return cli.HTTPGet( apiEndpoint, "addDevice", "address="+address, diff --git a/cmd/cli.go b/cmd/cli.go index 36ea21d806d15d8d375dad55a220f8fd1c102a16..1719e46debc53835d9337f6d47a88edf92ca311b 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -45,7 +45,7 @@ var cliCmd = &cobra.Command{ Short: "", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet(apiEndpoint, "init") + return cli.HTTPGet(apiEndpoint, "init") }, } diff --git a/cmd/cliSet.go b/cmd/cliSet.go index b16b4b8f5f865a4b9d129df16060e204da16fa4e..525125472c77281ca56d7e2b773c6a98831017e4 100644 --- a/cmd/cliSet.go +++ b/cmd/cliSet.go @@ -42,7 +42,7 @@ var cliSetCmd = &cobra.Command{ Short: "set a value on a device", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet( + return cli.HTTPGet( apiEndpoint, "set", "uuid="+uuid, diff --git a/cmd/getDevice.go b/cmd/getDevice.go index fb3bf1aedfd7025f787a783a9879b2b77fe9c465..b9d3408c15d9681c78ac447c152b563119211ed2 100644 --- a/cmd/getDevice.go +++ b/cmd/getDevice.go @@ -42,7 +42,7 @@ var getDeviceCmd = &cobra.Command{ Short: "gets device information from the controller", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet( + return cli.HTTPGet( apiEndpoint, "getDevice", "uuid="+uuid, diff --git a/cmd/getIds.go b/cmd/getIds.go index c729f84b7271c9290a05f28fdaa0f1df12e8ef6e..b4f0685be494c085b98226cb5c64f9877e4d1781 100644 --- a/cmd/getIds.go +++ b/cmd/getIds.go @@ -42,7 +42,7 @@ var getIdsCmd = &cobra.Command{ Short: "gets device IDs from the controller", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet(apiEndpoint, "getIDs") + return cli.HTTPGet(apiEndpoint, "getIDs") }, } diff --git a/cmd/init.go b/cmd/init.go index 4cedc0eddc431560bd0c51f203ddc50367b49ff1..9a140f3c26fa1cd8c35a67987db1bf48326ca324 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -42,7 +42,7 @@ var initCmd = &cobra.Command{ Short: "initialise SBI and PND", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet(apiEndpoint, "init") + return cli.HTTPGet(apiEndpoint, "init") }, } diff --git a/cmd/request.go b/cmd/request.go index 22c87338648cb8807ed3d2f7afd23648371e1321..7e887b79097f805e76d6bd8d78cdefd97c879b41 100644 --- a/cmd/request.go +++ b/cmd/request.go @@ -42,7 +42,7 @@ var requestCmd = &cobra.Command{ Short: "requests a path from a specified device on the controller", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet( + return cli.HTTPGet( apiEndpoint, "request", "uuid="+uuid, diff --git a/cmd/requestAll.go b/cmd/requestAll.go index 6bd906072c498dbc6ae0057db3c1e4afe4db3480..183d89d4a2b72a0e3b1acd02c7e31bf7d8cb4985 100644 --- a/cmd/requestAll.go +++ b/cmd/requestAll.go @@ -42,7 +42,7 @@ var requestAllCmd = &cobra.Command{ Short: "requests specified path from all devices on the controller", Long: ``, RunE: func(cmd *cobra.Command, args []string) error { - return cli.HttpGet( + return cli.HTTPGet( apiEndpoint, "requestAll", "sbi="+cliSbi,