mirror of
https://github.com/docker/compose.git
synced 2025-07-25 14:44:29 +02:00
build: Update golangci-lint
* Replace goling with revive as the former is deprecated Signed-off-by: Chris Crone <christopher.crone@docker.com>
This commit is contained in:
parent
d543ef3064
commit
d27bda5e1d
@ -11,7 +11,7 @@ linters:
|
|||||||
- gocyclo
|
- gocyclo
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
- golint
|
- revive
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ARG GO_VERSION=1.16-alpine
|
ARG GO_VERSION=1.16-alpine
|
||||||
ARG GOLANGCI_LINT_VERSION=v1.39.0-alpine
|
ARG GOLANGCI_LINT_VERSION=v1.40.1-alpine
|
||||||
ARG PROTOC_GEN_GO_VERSION=v1.4.3
|
ARG PROTOC_GEN_GO_VERSION=v1.4.3
|
||||||
|
|
||||||
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
|
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
|
||||||
|
@ -347,7 +347,7 @@ func ContainerGroupToContainer(containerID string, cg containerinstance.Containe
|
|||||||
status := GetStatus(cc, cg)
|
status := GetStatus(cc, cg)
|
||||||
platform := string(cg.OsType)
|
platform := string(cg.OsType)
|
||||||
|
|
||||||
var envVars map[string]string = nil
|
var envVars map[string]string
|
||||||
if cc.EnvironmentVariables != nil && len(*cc.EnvironmentVariables) != 0 {
|
if cc.EnvironmentVariables != nil && len(*cc.EnvironmentVariables) != 0 {
|
||||||
envVars = map[string]string{}
|
envVars = map[string]string{}
|
||||||
for _, envVar := range *cc.EnvironmentVariables {
|
for _, envVar := range *cc.EnvironmentVariables {
|
||||||
|
@ -570,7 +570,7 @@ func TestConvertContainerGroupStatus(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func container(status *string) containerinstance.Container {
|
func container(status *string) containerinstance.Container {
|
||||||
var state *containerinstance.ContainerState = nil
|
var state *containerinstance.ContainerState
|
||||||
if status != nil {
|
if status != nil {
|
||||||
state = &containerinstance.ContainerState{
|
state = &containerinstance.ContainerState{
|
||||||
State: status,
|
State: status,
|
||||||
@ -586,7 +586,7 @@ func container(status *string) containerinstance.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func group(status *string) containerinstance.ContainerGroup {
|
func group(status *string) containerinstance.ContainerGroup {
|
||||||
var view *containerinstance.ContainerGroupPropertiesInstanceView = nil
|
var view *containerinstance.ContainerGroupPropertiesInstanceView
|
||||||
if status != nil {
|
if status != nil {
|
||||||
view = &containerinstance.ContainerGroupPropertiesInstanceView{
|
view = &containerinstance.ContainerGroupPropertiesInstanceView{
|
||||||
State: status,
|
State: status,
|
||||||
|
@ -58,7 +58,7 @@ func convertPortsToAci(service serviceConfigAciHelper) ([]containerinstance.Cont
|
|||||||
Protocol: groupProtocol,
|
Protocol: groupProtocol,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
var dnsLabelName *string = nil
|
var dnsLabelName *string
|
||||||
if service.DomainName != "" {
|
if service.DomainName != "" {
|
||||||
dnsLabelName = &service.DomainName
|
dnsLabelName = &service.DomainName
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ func getRegistryCredentials(project compose.Project, helper registryHelper) ([]c
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var cloudEnvironment *login.CloudEnvironment = nil
|
var cloudEnvironment *login.CloudEnvironment
|
||||||
if ce, err := loginService.GetCloudEnvironment(); err != nil {
|
if ce, err := loginService.GetCloudEnvironment(); err != nil {
|
||||||
cloudEnvironment = &ce
|
cloudEnvironment = &ce
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var healthy bool = true
|
var healthy = true
|
||||||
|
|
||||||
func fail(w http.ResponseWriter, req *http.Request) {
|
func fail(w http.ResponseWriter, req *http.Request) {
|
||||||
healthy = false
|
healthy = false
|
||||||
|
@ -385,7 +385,7 @@ func TestContainerRunAttached(t *testing.T) {
|
|||||||
|
|
||||||
// Used in subtests
|
// Used in subtests
|
||||||
var (
|
var (
|
||||||
container string = "test-container"
|
container = "test-container"
|
||||||
endpoint string
|
endpoint string
|
||||||
followLogsProcess *icmd.Result
|
followLogsProcess *icmd.Result
|
||||||
)
|
)
|
||||||
|
@ -459,7 +459,7 @@ func TestNonstandardCloudEnvironment(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"resourceManager": "https://management.docker.com/"
|
"resourceManager": "https://management.docker.com/"
|
||||||
}]`)
|
}]`)
|
||||||
var metadataReqCount int32 = 0
|
var metadataReqCount int32
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
_, err := w.Write(dockerCloudMetadata)
|
_, err := w.Write(dockerCloudMetadata)
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
@ -220,8 +220,5 @@ func startDependencies(ctx context.Context, backend compose.Service, project typ
|
|||||||
if err := backend.Create(ctx, &project, compose.CreateOptions{}); err != nil {
|
if err := backend.Create(ctx, &project, compose.CreateOptions{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := backend.Start(ctx, &project, compose.StartOptions{}); err != nil {
|
return backend.Start(ctx, &project, compose.StartOptions{})
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ func makeColorFunc(code string) colorFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var nextColor func() colorFunc = rainbowColor
|
var nextColor = rainbowColor
|
||||||
|
|
||||||
func rainbowColor() colorFunc {
|
func rainbowColor() colorFunc {
|
||||||
return <-loop
|
return <-loop
|
||||||
|
@ -116,7 +116,7 @@ func (kc *KubeClient) GetLogs(ctx context.Context, projectName string, consumer
|
|||||||
|
|
||||||
// WaitForPodState blocks until pods reach desired state
|
// WaitForPodState blocks until pods reach desired state
|
||||||
func (kc KubeClient) WaitForPodState(ctx context.Context, opts WaitForStatusOptions) error {
|
func (kc KubeClient) WaitForPodState(ctx context.Context, opts WaitForStatusOptions) error {
|
||||||
var timeout time.Duration = time.Minute
|
var timeout = time.Minute
|
||||||
if opts.Timeout != nil {
|
if opts.Timeout != nil {
|
||||||
timeout = *opts.Timeout
|
timeout = *opts.Timeout
|
||||||
}
|
}
|
||||||
|
@ -63,10 +63,7 @@ func (vs *volumeService) Create(ctx context.Context, name string, options interf
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (vs *volumeService) Delete(ctx context.Context, volumeID string, options interface{}) error {
|
func (vs *volumeService) Delete(ctx context.Context, volumeID string, options interface{}) error {
|
||||||
if err := vs.apiClient.VolumeRemove(ctx, volumeID, false); err != nil {
|
return vs.apiClient.VolumeRemove(ctx, volumeID, false)
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vs *volumeService) Inspect(ctx context.Context, volumeID string) (volumes.Volume, error) {
|
func (vs *volumeService) Inspect(ctx context.Context, volumeID string) (volumes.Volume, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user