Skip to content

Commit

Permalink
replace ioutil, errors, go-1.16 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Jul 5, 2021
1 parent c995d0b commit b3db951
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.32.2
args: -p bugs -p unused

- name: Docker Image
uses: fi-ts/action-docker-make@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.32.2
args: -p bugs -p unused

- name: Set tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.32.2
args: -p bugs -p unused

- name: Set tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM metalstack/builder:latest as builder

FROM alpine:3.12
FROM alpine:3.14

RUN apk add \
ca-certificates \
Expand Down
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module github.com/metal-stack/bmc-catcher

go 1.15
go 1.16

require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/metal-stack/go-hal v0.3.0
github.com/metal-stack/metal-go v0.12.2
github.com/metal-stack/v v1.0.2
github.com/pkg/errors v0.9.1
github.com/metal-stack/go-hal v0.3.4
github.com/metal-stack/metal-go v0.15.1
github.com/metal-stack/v v1.0.3
github.com/stretchr/testify v1.7.0
go.uber.org/zap v1.16.0
go.universe.tf/netboot v0.0.0-20201124111825-bdaec9d82638
go.uber.org/zap v1.18.1
go.universe.tf/netboot v0.0.0-20210617221821-fc2840fa7b05
)
365 changes: 295 additions & 70 deletions go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions internal/leases/leases.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package leases

import (
"github.com/pkg/errors"
"io/ioutil"
"fmt"
"os"
"time"
)

Expand Down Expand Up @@ -34,13 +34,13 @@ func ReadLeases(leaseFile string) (Leases, error) {
leasesContent := mustRead(leaseFile)
leases, err := Parse(leasesContent)
if err != nil {
return nil, errors.Wrapf(err, "could not parse leases file")
return nil, fmt.Errorf("could not parse leases file:%w", err)
}
return leases, nil
}

func mustRead(name string) string {
c, err := ioutil.ReadFile(name)
c, err := os.ReadFile(name)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit b3db951

Please sign in to comment.