Skip to content

Commit eb835d3

Browse files
committed
chore: fix golint errors / remove ci lib.go exclusion
1 parent 5f0e6c4 commit eb835d3

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ jobs:
3939
# working-directory: somedir
4040

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

4544
# Optional: show only new issues if it's a pull request. The default value is `false`.
4645
# only-new-issues: true

internal/native/message_server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (m *Message) WithResponseJSONContents(body interface{}) *Message {
184184
func (m *Message) WithContents(part interactionPart, contentType string, body []byte) *Message {
185185

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

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

446-
return res == true
446+
return res
447447
}
448448

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

485-
return res == true
485+
return res
486486
}
487487

488488
// WritePactFile writes the Pact to file.

internal/native/mock_server.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func Init(logLevel string) {
106106
// MockServer is the public interface for managing the HTTP mock server
107107
type MockServer struct {
108108
pact *Pact
109-
messagePact *MessagePact
109+
// messagePact *MessagePact
110110
interactions []*Interaction
111111
}
112112

@@ -263,9 +263,9 @@ func GetTLSConfig() *tls.Config {
263263
// pactffi_free_string(str)
264264
// }
265265

266-
func libRustFree(str string) {
267-
pactffi_string_delete(str)
268-
}
266+
// func libRustFree(str string) {
267+
// pactffi_string_delete(str)
268+
// }
269269

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

568-
type stringLike interface {
569-
String() string
570-
}
568+
// type stringLike interface {
569+
// String() string
570+
// }
571571

572572
func stringFromInterface(obj interface{}) string {
573573
switch t := obj.(type) {

0 commit comments

Comments
 (0)