Skip to content

Commit

Permalink
chore: fix golint errors / remove ci lib.go exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Sep 5, 2024
1 parent 5f0e6c4 commit eb835d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# ignore the lib.go file as it only contains cgo annotations
args: --skip-files internal/native/lib.go --timeout 2m
args: --timeout 2m

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
6 changes: 3 additions & 3 deletions internal/native/message_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (m *Message) WithResponseJSONContents(body interface{}) *Message {
func (m *Message) WithContents(part interactionPart, contentType string, body []byte) *Message {

res := pactffi_with_body(m.handle, int32(part), contentType, string(body))
log.Println("[DEBUG] response from pactffi_interaction_contents", (res == true))
log.Println("[DEBUG] response from pactffi_interaction_contents", res)

return m
}
Expand Down Expand Up @@ -443,7 +443,7 @@ func (m *MessageServer) CleanupMockServer(port int) bool {
log.Println("[DEBUG] mock server cleaning up port:", port)
res := pactffi_cleanup_mock_server(int32(port))

return res == true
return res
}

// MockServerMismatchedRequests returns a JSON object containing any mismatches from
Expand Down Expand Up @@ -482,7 +482,7 @@ func (m *MessageServer) MockServerMatched(port int) bool {
// log.Println("MATCHED RES?")
// log.Println(int(res))

return res == true
return res
}

// WritePactFile writes the Pact to file.
Expand Down
14 changes: 7 additions & 7 deletions internal/native/mock_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func Init(logLevel string) {
// MockServer is the public interface for managing the HTTP mock server
type MockServer struct {
pact *Pact
messagePact *MessagePact
// messagePact *MessagePact
interactions []*Interaction
}

Expand Down Expand Up @@ -263,9 +263,9 @@ func GetTLSConfig() *tls.Config {
// pactffi_free_string(str)
// }

func libRustFree(str string) {
pactffi_string_delete(str)
}
// func libRustFree(str string) {
// pactffi_string_delete(str)
// }

// Start starts up the mock HTTP server on the given address:port and TLS config
// https://docs.rs/pact_mock_server_ffi/0.0.7/pact_mock_server_ffi/fn.create_mock_server_for_pact.html
Expand Down Expand Up @@ -565,9 +565,9 @@ func (i *Interaction) WithStatus(status int) *Interaction {
return i
}

type stringLike interface {
String() string
}
// type stringLike interface {
// String() string
// }

func stringFromInterface(obj interface{}) string {
switch t := obj.(type) {
Expand Down

0 comments on commit eb835d3

Please sign in to comment.