Skip to content

Commit

Permalink
Merge branch 'master' into snyk-fix-a298edb362c0da43c59ca7a8d7ae9f30
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jan 19, 2024
2 parents aa3c52e + 120b3be commit 4f42c5c
Show file tree
Hide file tree
Showing 36 changed files with 74 additions and 1,315 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
# version: v1.29
version: v1.53
version: v1.55

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.20
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-java@v3 # Needed for the Avro example
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ deps: download_plugins
download_plugins:
@echo "--- 🐿 Installing plugins"; \
./scripts/install-cli.sh
~/.pact/bin/pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/tag/v-0.3.4
~/.pact/bin/pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/tag/v-0.3.8
~/.pact/bin/pact-plugin-cli -y install https://github.com/pact-foundation/pact-plugins/releases/tag/csv-plugin-0.0.1
~/.pact/bin/pact-plugin-cli -y install https://github.com/mefellows/pact-matt-plugin/releases/tag/v0.0.9
~/.pact/bin/pact-plugin-cli -y install https://github.com/austek/pact-avro-plugin/releases/tag/v0.0.4
~/.pact/bin/pact-plugin-cli -y install https://github.com/austek/pact-avro-plugin/releases/tag/v0.0.3

cli:
@if [ ! -d pact/bin ]; then\
Expand Down
4 changes: 2 additions & 2 deletions command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package command

import (
"fmt"
"io/ioutil"
"io"
"log"
"os"

Expand Down Expand Up @@ -50,6 +50,6 @@ func setLogLevel(verbose bool, level string) {
log.SetOutput(filter)

if !verbose {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}
}
4 changes: 2 additions & 2 deletions command/root_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package command

import (
"io/ioutil"
"io"
"log"
"os"
"strings"
Expand Down Expand Up @@ -55,7 +55,7 @@ func captureOutput(action func()) string {
action()

w.Close()
out, _ := ioutil.ReadAll(r)
out, _ := io.ReadAll(r)
os.Stderr = rescueStderr

return strings.TrimSpace(string(out))
Expand Down
2 changes: 1 addition & 1 deletion consumer/http_v4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestHttpV4TypeSystem(t *testing.T) {
UponReceiving("some scenario").
UsingPlugin(PluginConfig{
Plugin: "protobuf",
Version: "0.3.0",
Version: "0.3.8",
}).
WithRequest("GET", "/").
// WithRequest("GET", "/", func(b *V4InteractionWithPluginRequestBuilder) {
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ An example route using the standard Go http package might look like this:
// Retrieve the Provider State
var state types.ProviderState
body, _ := ioutil.ReadAll(req.Body)
body, _ := io.ReadAll(req.Body)
req.Body.Close()
json.Unmarshal(body, &state)
Expand Down
6 changes: 3 additions & 3 deletions examples/avro/avro_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package avro

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -45,7 +45,7 @@ func TestAvroHTTP(t *testing.T) {
UponReceiving("A request to do get some Avro stuff").
UsingPlugin(consumer.PluginConfig{
Plugin: "avro",
Version: "0.0.4",
Version: "0.0.3",
}).
WithRequest("GET", "/avro").
WillRespondWith(200, func(res *consumer.V4InteractionWithPluginResponseBuilder) {
Expand Down Expand Up @@ -82,7 +82,7 @@ func callServiceHTTP(msc consumer.MockServerConfig) (*User, error) {
return nil, err
}

bytes, err := ioutil.ReadAll(res.Body)
bytes, err := io.ReadAll(res.Body)

if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions examples/avro/codec.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package avro

import (
"io/ioutil"


"os"
"github.com/linkedin/goavro/v2"
)

func getCodec() *goavro.Codec {
schema, err := ioutil.ReadFile("user.avsc")
schema, err := os.ReadFile("user.avsc")
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/consumer_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
Expand Down Expand Up @@ -188,7 +188,7 @@ var rawTest = func(query string) func(config consumer.MockServerConfig) error {
Path: "/foobar",
RawQuery: query,
},
Body: ioutil.NopCloser(strings.NewReader(`{"id": 27, "name":"billy", "lastName":"sampson", "datetime":"2021-01-01T08:00:45"}`)),
Body: io.NopCloser(strings.NewReader(`{"id": 27, "name":"billy", "lastName":"sampson", "datetime":"2021-01-01T08:00:45"}`)),
Header: make(http.Header),
}

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/grpc_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestGrpcInteraction(t *testing.T) {
Given("feature 'Big Tree' exists").
UsingPlugin(message.PluginConfig{
Plugin: "protobuf",
Version: "0.3.4",
Version: "0.3.8",
}).
WithContents(grpcInteraction, "application/protobuf").
StartTransport("grpc", "127.0.0.1", nil). // For plugin tests, we can't assume if a transport is needed, so this is optional
Expand Down
4 changes: 2 additions & 2 deletions examples/grpc/routeguide/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"log"
"math"
"net"
Expand Down Expand Up @@ -155,7 +155,7 @@ func (s *routeGuideServer) loadFeatures(filePath string) {
var data []byte
if filePath != "" {
var err error
data, err = ioutil.ReadFile(filePath)
data, err = os.ReadFile(filePath)
if err != nil {
log.Fatalf("Failed to load default features: %v", err)
}
Expand Down
63 changes: 0 additions & 63 deletions examples/pacts/MattConsumer-MattProvider.json

This file was deleted.

50 changes: 0 additions & 50 deletions examples/pacts/PactGoProductAPIConsumer-PactGoProductAPI.json

This file was deleted.

Loading

0 comments on commit 4f42c5c

Please sign in to comment.