diff --git a/command/install.go b/command/install.go index 253abc065..d604aeaaf 100644 --- a/command/install.go +++ b/command/install.go @@ -14,7 +14,7 @@ var installCmd = &cobra.Command{ Use: "install", Short: "Check required tools", Long: "Checks versions of required Pact CLI tools for used by the library", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { setLogLevel(verbose, logLevel) // Run the installer diff --git a/command/version.go b/command/version.go index 149869fe0..39366dbc2 100644 --- a/command/version.go +++ b/command/version.go @@ -12,7 +12,7 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of Pact Go", Long: `All software has versions. This is Pact Go's`, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { fmt.Printf("Pact Go CLI %s, using CLI tools version %s", version, cliToolsVersion) }, } diff --git a/dsl/client.go b/dsl/client.go index 42cb4ebfb..b09bff4b3 100644 --- a/dsl/client.go +++ b/dsl/client.go @@ -135,7 +135,7 @@ func (p *PactClient) StopServer(server *types.MockServer) (*types.MockServer, er } // RemoveAllServers stops all remote Pact Mock Servers. -func (p *PactClient) RemoveAllServers(server *types.MockServer) []*types.MockServer { +func (p *PactClient) RemoveAllServers(_ *types.MockServer) []*types.MockServer { log.Println("[DEBUG] client: stop server") for _, s := range p.verificationSvcManager.List() { diff --git a/dsl/message.go b/dsl/message.go index 809cd38b0..ef6db7b9f 100644 --- a/dsl/message.go +++ b/dsl/message.go @@ -58,7 +58,7 @@ type State struct { // Given specifies a provider state. Optional. func (p *Message) Given(state string) *Message { - p.States = []State{State{Name: state}} + p.States = []State{{Name: state}} return p } diff --git a/dsl/mock_client.go b/dsl/mock_client.go index dc46b407b..0e5806989 100644 --- a/dsl/mock_client.go +++ b/dsl/mock_client.go @@ -34,7 +34,7 @@ func newMockClient() *mockClient { } // StartServer starts a remote Pact Mock Server. -func (p *mockClient) StartServer(args []string, port int) *types.MockServer { +func (p *mockClient) StartServer(_ []string, _ int) *types.MockServer { return p.MockServer } @@ -44,33 +44,33 @@ func (p *mockClient) ListServers() []*types.MockServer { } // StopServer stops a remote Pact Mock Server. -func (p *mockClient) StopServer(server *types.MockServer) (*types.MockServer, error) { +func (p *mockClient) StopServer(_ *types.MockServer) (*types.MockServer, error) { return p.StopServerResponse, p.StopServerError } // RemoveAllServers stops all remote Pact Mock Servers. -func (p *mockClient) RemoveAllServers(server *types.MockServer) []*types.MockServer { +func (p *mockClient) RemoveAllServers(_ *types.MockServer) []*types.MockServer { return p.RemoveAllServersResponse } // VerifyProvider runs the verification process against a running Provider. -func (p *mockClient) VerifyProvider(request types.VerifyRequest) ([]types.ProviderVerifierResponse, error) { +func (p *mockClient) VerifyProvider(_ types.VerifyRequest) ([]types.ProviderVerifierResponse, error) { return p.VerifyProviderResponse, p.VerifyProviderError } // UpdateMessagePact adds a pact message to a contract file -func (p *mockClient) UpdateMessagePact(request types.PactMessageRequest) error { +func (p *mockClient) UpdateMessagePact(_ types.PactMessageRequest) error { return p.UpdateMessagePactError } // ReifyMessage takes a structured object, potentially containing nested Matchers // and returns an object with just the example (generated) content // The object may be a simple JSON primitive e.g. string or number or a complex object -func (p *mockClient) ReifyMessage(request *types.PactReificationRequest) (res *types.ReificationResponse, err error) { +func (p *mockClient) ReifyMessage(_ *types.PactReificationRequest) (res *types.ReificationResponse, err error) { return p.ReifyMessageResponse, p.ReifyMessageError } // PublishPacts publishes pacts to a broker -func (p *mockClient) PublishPacts(request types.PublishRequest) error { +func (p *mockClient) PublishPacts(_ types.PublishRequest) error { return p.PublishPactsError } diff --git a/dsl/service_mock.go b/dsl/service_mock.go index 052f6f8af..e9d116606 100644 --- a/dsl/service_mock.go +++ b/dsl/service_mock.go @@ -60,6 +60,6 @@ func (s *ServiceMock) Command() *exec.Cmd { } // NewService creates a new MockService with default settings. -func (s *ServiceMock) NewService(args []string) client.Service { +func (s *ServiceMock) NewService(_ []string) client.Service { return s }