Skip to content

Commit

Permalink
Format for Go 1.19
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Feb 23, 2023
1 parent 600ae24 commit 5c6e347
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 38 deletions.
14 changes: 7 additions & 7 deletions builder/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func Test_getPackages(t *testing.T) {
{
title: "Single Option",
availableBuildOptions: []stack.BuildOption{
stack.BuildOption{Name: "dev",
{Name: "dev",
Packages: []string{"jq", "hw", "ke"}},
},
requestedBuildOptions: []string{"dev"},
Expand All @@ -370,9 +370,9 @@ func Test_getPackages(t *testing.T) {
{
title: "Two Options one chosen",
availableBuildOptions: []stack.BuildOption{
stack.BuildOption{Name: "dev",
{Name: "dev",
Packages: []string{"jq", "hw", "ke"}},
stack.BuildOption{Name: "debug",
{Name: "debug",
Packages: []string{"lr", "kt", "jy"}},
},
requestedBuildOptions: []string{"dev"},
Expand All @@ -381,9 +381,9 @@ func Test_getPackages(t *testing.T) {
{
title: "Two Options two chosen",
availableBuildOptions: []stack.BuildOption{
stack.BuildOption{Name: "dev",
{Name: "dev",
Packages: []string{"jq", "hw", "ke"}},
stack.BuildOption{Name: "debug",
{Name: "debug",
Packages: []string{"lr", "kt", "jy"}},
},
requestedBuildOptions: []string{"dev", "debug"},
Expand All @@ -392,9 +392,9 @@ func Test_getPackages(t *testing.T) {
{
title: "Two Options two chosen with overlaps",
availableBuildOptions: []stack.BuildOption{
stack.BuildOption{Name: "dev",
{Name: "dev",
Packages: []string{"jq", "hw", "ke"}},
stack.BuildOption{Name: "debug",
{Name: "debug",
Packages: []string{"lr", "jq", "hw"}},
},
requestedBuildOptions: []string{"dev", "debug"},
Expand Down
2 changes: 1 addition & 1 deletion commands/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Test_PushValidation(t *testing.T) {

for _, testCase := range testCases {
functions := map[string]stack.Function{
"cli": stack.Function{
"cli": {
Name: testCase.name,
Image: testCase.image,
},
Expand Down
2 changes: 1 addition & 1 deletion commands/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func filterStoreList(functions []storeV2.StoreFunction, platform string) []store
return filteredList
}

//getValueIgnoreCase get a key value from map by ignoring case for key
// getValueIgnoreCase get a key value from map by ignoring case for key
func getValueIgnoreCase(kv map[string]string, key string) (string, bool) {
for k, v := range kv {
if strings.EqualFold(k, key) {
Expand Down
20 changes: 10 additions & 10 deletions flags/time_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import (

// TimeFormat is a timestamp format string that also accepts the following RFC names as shortcuts
//
// ANSIC = "Mon Jan _2 15:04:05 2006"
// UnixDate = "Mon Jan _2 15:04:05 MST 2006"
// RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
// RFC822 = "02 Jan 06 15:04 MST"
// RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
// RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
// RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
// RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
// RFC3339 = "2006-01-02T15:04:05Z07:00"
// RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
// ANSIC = "Mon Jan _2 15:04:05 2006"
// UnixDate = "Mon Jan _2 15:04:05 MST 2006"
// RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
// RFC822 = "02 Jan 06 15:04 MST"
// RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
// RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
// RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
// RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
// RFC3339 = "2006-01-02T15:04:05Z07:00"
// RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
//
// Any string is accepted
type TimeFormat string
Expand Down
8 changes: 4 additions & 4 deletions proxy/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"github.com/openfaas/faas-cli/config"
)

//CLIAuth auth struct for the CLI
// CLIAuth auth struct for the CLI
type CLIAuth struct {
Username string
Password string
Token string
}

//BasicAuth basic authentication type
// BasicAuth basic authentication type
type BasicAuth struct {
username string
password string
Expand All @@ -24,7 +24,7 @@ func (auth *BasicAuth) Set(req *http.Request) error {
return nil
}

//BearerToken bearer token
// BearerToken bearer token
type BearerToken struct {
token string
}
Expand All @@ -34,7 +34,7 @@ func (c *BearerToken) Set(req *http.Request) error {
return nil
}

//NewCLIAuth returns a new CLI Auth
// NewCLIAuth returns a new CLI Auth
func NewCLIAuth(token string, gateway string) (ClientAuth, error) {
authConfig, _ := config.LookupAuthConfig(gateway)

Expand Down
2 changes: 1 addition & 1 deletion proxy/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
types "github.com/openfaas/faas-provider/types"
)

//GetFunctionInfo get an OpenFaaS function information
// GetFunctionInfo get an OpenFaaS function information
func (c *Client) GetFunctionInfo(ctx context.Context, functionName string, namespace string) (types.FunctionStatus, error) {
var (
result types.FunctionStatus
Expand Down
4 changes: 2 additions & 2 deletions proxy/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func Test_GetLogs_200OK(t *testing.T) {
params := logs.Request{Name: "testFunc"}

lines := []logs.Message{
logs.Message{Name: params.Name, Text: "test"},
logs.Message{Name: params.Name, Text: "test2"},
{Name: params.Name, Text: "test"},
{Name: params.Name, Text: "test2"},
}

s := test.MockHttpServer(t, []test.Request{
Expand Down
2 changes: 1 addition & 1 deletion proxy/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
types "github.com/openfaas/faas-provider/types"
)

//ScaleFunction scale a function
// ScaleFunction scale a function
func (c *Client) ScaleFunction(ctx context.Context, functionName, namespace string, replicas uint64) error {

scaleReq := types.ScaleServiceRequest{
Expand Down
2 changes: 1 addition & 1 deletion proxy/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/openfaas/faas/gateway/types"
)

//GetSystemInfo get system information from /system/info endpoint
// GetSystemInfo get system information from /system/info endpoint
func (c *Client) GetSystemInfo(ctx context.Context) (types.GatewayInfo, error) {
infoEndPoint := "/system/info"
var info types.GatewayInfo
Expand Down
2 changes: 1 addition & 1 deletion schema/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package schema

import "github.com/openfaas/faas-provider/types"

//FunctionDescription information related to a function
// FunctionDescription information related to a function
type FunctionDescription struct {
types.FunctionStatus
Status string
Expand Down
2 changes: 1 addition & 1 deletion schema/knative/v1/serving.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "github.com/openfaas/faas-cli/schema"

const APIVersionLatest = "serving.knative.dev/v1"

//ServingServiceCRD root level YAML definition for the object
// ServingServiceCRD root level YAML definition for the object
type ServingServiceCRD struct {
//APIVersion CRD API version
APIVersion string `yaml:"apiVersion"`
Expand Down
6 changes: 3 additions & 3 deletions schema/openfaas/v1/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/openfaas/faas-cli/stack"
)

//APIVersionLatest latest API version of CRD
// APIVersionLatest latest API version of CRD
const APIVersionLatest = "openfaas.com/v1"

//Spec describe characteristics of the object
// Spec describe characteristics of the object
type Spec struct {
//Name name of the function
Name string `yaml:"name"`
Expand All @@ -38,7 +38,7 @@ type Spec struct {
ReadOnlyRootFilesystem bool `yaml:"readOnlyRootFilesystem,omitempty"`
}

//CRD root level YAML definition for the object
// CRD root level YAML definition for the object
type CRD struct {
//APIVersion CRD API version
APIVersion string `yaml:"apiVersion"`
Expand Down
6 changes: 3 additions & 3 deletions schema/openfaas/v1alpha2/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/openfaas/faas-cli/stack"
)

//APIVersionLatest latest API version of CRD
// APIVersionLatest latest API version of CRD
const APIVersionLatest = "openfaas.com/v1"

//Spec describe characteristics of the object
// Spec describe characteristics of the object
type Spec struct {
//Name name of the function
Name string `yaml:"name"`
Expand All @@ -34,7 +34,7 @@ type Spec struct {
Secrets []string `yaml:"secrets,omitempty"`
}

//CRD root level YAML definition for the object
// CRD root level YAML definition for the object
type CRD struct {
//APIVersion CRD API version
APIVersion string `yaml:"apiVersion"`
Expand Down
4 changes: 2 additions & 2 deletions schema/store/v2/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package v2

//StoreFunction represents a multi-arch function in the store
// StoreFunction represents a multi-arch function in the store
type StoreFunction struct {
Icon string `json:"icon"`
Title string `json:"title"`
Expand All @@ -19,7 +19,7 @@ type StoreFunction struct {
Images map[string]string `json:"images"`
}

//GetImageName get image name of function for a platform
// GetImageName get image name of function for a platform
func (s *StoreFunction) GetImageName(platform string) string {
imageName, _ := s.Images[platform]
return imageName
Expand Down

0 comments on commit 5c6e347

Please sign in to comment.