Skip to content

Commit

Permalink
Upgrade to Go 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Mar 5, 2021
1 parent aed9f93 commit c1e28b9
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 123 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
go-version: [1.15]
go-version: [1.16]

fail-fast: true

Expand Down Expand Up @@ -75,10 +75,10 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:
- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/[email protected]
with:
go-version: 1.15
go-version: 1.16

- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions cmd/cmd_bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"html/template"
"io"
"io/ioutil"
"os"
"text/tabwriter"

"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -171,7 +171,7 @@ func bitbucketRepositories(c *cli.Context) error {
}

templateFile := c.Path("template")
tmplContent, err := ioutil.ReadFile(templateFile)
tmplContent, err := os.ReadFile(templateFile)
if err != nil {
return err
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/cmd_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -174,7 +173,7 @@ func githubMembers(c *cli.Context) error {
}

templateFile := c.Path("template")
tmplContent, err := ioutil.ReadFile(templateFile)
tmplContent, err := os.ReadFile(templateFile)
if err != nil {
return err
}
Expand Down Expand Up @@ -250,7 +249,7 @@ func githubRepositories(c *cli.Context) error {
}

templateFile := c.Path("template")
tmplContent, err := ioutil.ReadFile(templateFile)
tmplContent, err := os.ReadFile(templateFile)
if err != nil {
return err
}
Expand Down Expand Up @@ -296,7 +295,7 @@ func githubContents(c *cli.Context) error {
return err
}
}
err := ioutil.WriteFile(output, contents, 0644)
err := os.WriteFile(output, contents, 0644)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/philips-labs/tabia

go 1.15
go 1.16

require (
github.com/antonmedv/expr v1.8.9
Expand Down
105 changes: 0 additions & 105 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/bitbucket/projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bitbucket_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -31,7 +31,7 @@ func TestListProjectsRaw(t *testing.T) {
defer resp.Close()

assert.NotNil(resp)
bytes, err := ioutil.ReadAll(resp)
bytes, err := io.ReadAll(resp)

assert.NotEmpty(bytes)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/bitbucket/repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bitbucket_test

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -31,7 +31,7 @@ func TestListRepositoriesRaw(t *testing.T) {
defer resp.Close()

assert.NotNil(resp)
bytes, err := ioutil.ReadAll(resp)
bytes, err := io.ReadAll(resp)

assert.NotEmpty(bytes)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/github/contents.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package github

import (
"context"
"io/ioutil"
"io"
)

// DownloadContents downloads file contents from the given filepath
Expand All @@ -13,5 +13,5 @@ func (c *Client) DownloadContents(ctx context.Context, owner, repo, filepath str
}

defer contents.Close()
return ioutil.ReadAll(contents)
return io.ReadAll(contents)
}
3 changes: 1 addition & 2 deletions lib/github/contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package github_test

import (
"context"
"io/ioutil"
"os"
"testing"

Expand All @@ -16,7 +15,7 @@ func TestDownloadContents(t *testing.T) {
gh := github.NewClientWithTokenAuth(os.Getenv("TABIA_GITHUB_TOKEN"), nil)
contents, err := gh.DownloadContents(context.Background(), "philips-labs", "tabia", "README.md")
if assert.NoError(err) {
readme, _ := ioutil.ReadFile("../../README.md")
readme, _ := os.ReadFile("../../README.md")
assert.NotEmpty(contents)
assert.Equal(string(readme[:100]), string(contents[:100]))
}
Expand Down

0 comments on commit c1e28b9

Please sign in to comment.