Skip to content

Commit

Permalink
use go 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
paupm committed Apr 3, 2024
1 parent 5c2d783 commit 9ffe7a4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17]
go-version: [1.19]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-buster AS build
FROM golang:1.19-buster AS build

RUN apt-get update \
&& apt-get install -y protobuf-compiler
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
- bootstrap.memory_lock=true
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch
- vm.max_map_count=262144
# - bootstrap.system_call_filter=false
ulimits:
memlock:
soft: -1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ require (
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

go 1.17
go 1.19
3 changes: 1 addition & 2 deletions pkg/readers/adapters/amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
amqpAdapter "github.com/softonic/homing-pigeon/pkg/readers/adapters/amqp"
"github.com/streadway/amqp"
"html/template"
"io/ioutil"
"k8s.io/klog"
"os"
"strconv"
Expand Down Expand Up @@ -83,7 +82,7 @@ func NewAmqpReaderAdapter(config amqpAdapter.Config) (ReadAdapter, error) {
cfg := new(tls.Config)
cfg.RootCAs = x509.NewCertPool()
var ca []byte
ca, err = ioutil.ReadFile(caPath)
ca, err = os.ReadFile(caPath)
if err == nil {
cfg.RootCAs.AppendCertsFromPEM(ca)
klog.V(0).Infof("Added CA certificate %s", caPath)
Expand Down
10 changes: 5 additions & 5 deletions pkg/writers/adapters/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"io"
"io/ioutil"
"os"
"strings"
"testing"
)
Expand Down Expand Up @@ -98,7 +98,7 @@ func TestBulkActionWithSingleItemSucessful(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: ioutil.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")),
Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand All @@ -125,7 +125,7 @@ func TestBulkActionWithSingleItemUnsuccessful(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: ioutil.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")),
Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand All @@ -152,7 +152,7 @@ func TestBulkActionWithMixedItemStatus(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: ioutil.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")),
Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand Down Expand Up @@ -189,7 +189,7 @@ func TestBulkActionWithOnlyMetadata(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: ioutil.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")),
Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")),
}
expectedBody := "{\"delete\":{\"_id\":\"123\"}}\n"
bulk.On("func1", expectedBody).Once().Return(&response, nil)
Expand Down

0 comments on commit 9ffe7a4

Please sign in to comment.