Skip to content

Commit

Permalink
Upgrade to go 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
wormi4ok committed Feb 26, 2021
1 parent 5086653 commit 26f71de
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x
- name: Prepare PR_TAG
run: |
PR_TAG="$(git describe --tags --abbrev=0)-PR-${{ github.event.number }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
go-version: 1.16.x
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.15.x
go-version: 1.16.x
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
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.15-alpine AS build
FROM golang:1.16-alpine3.13 AS build

ENV CGO_ENABLED 0

Expand Down
3 changes: 1 addition & 2 deletions encoding/enex/enex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"encoding/base64"
"encoding/xml"
"io/ioutil"
"os"
"reflect"
"testing"
Expand Down Expand Up @@ -72,7 +71,7 @@ func TestDecode(t *testing.T) {
}

func readFile(filename string) []byte {
file, err := ioutil.ReadFile(filename)
file, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
Expand Down
3 changes: 1 addition & 2 deletions file/file_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package file_test

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -29,7 +28,7 @@ func TestSave(t *testing.T) {

// File should be created
filePath := filepath.FromSlash(dirName + "/" + fileName)
b, err := ioutil.ReadFile(filePath)
b, err := os.ReadFile(filePath)
if err != nil {
t.Error(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/wormi4ok/evernote2md

go 1.15
go 1.16

require (
github.com/cheggaaa/pb/v3 v3.0.4
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdc
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
github.com/cheggaaa/pb/v3 v3.0.4 h1:QZEPYOj2ix6d5oEg63fbHmpolrnNiwjUsk+h74Yt4bM=
github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
Expand All @@ -17,7 +16,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
Expand All @@ -32,9 +30,7 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
4 changes: 2 additions & 2 deletions internal/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"regexp"
"strconv"
Expand Down Expand Up @@ -57,7 +57,7 @@ func (c *Converter) mapResources(note *enex.Note, md *markdown.Note) {
names := map[string]int{}
r := note.Resources
for i := range r {
p, err := ioutil.ReadAll(decoder(r[i].Data))
p, err := io.ReadAll(decoder(r[i].Data))
if c.err = err; err != nil {
return
}
Expand Down
6 changes: 3 additions & 3 deletions internal/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/base64"
"flag"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"testing"
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestConvert(t *testing.T) {
return
}
if *update {
if err := ioutil.WriteFile(filepath.Join("testdata", "golden.md"), got.Content, 0644); err == nil {
if err := os.WriteFile(filepath.Join("testdata", "golden.md"), got.Content, 0644); err == nil {
t.SkipNow()
}
}
Expand All @@ -118,7 +118,7 @@ func TestConvert(t *testing.T) {

func goldenFile(t *testing.T, filename string) []byte {
golden := filepath.Join("testdata", filename)
expected, err := ioutil.ReadFile(golden)
expected, err := os.ReadFile(golden)
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand All @@ -28,7 +27,7 @@ func Test_run(t *testing.T) {
setLogLevel(false)
tmpDir := tDir(t)
input := filepath.FromSlash(tmpDir + "/export.enex")
err := ioutil.WriteFile(input, []byte(sampleFile), 0600)
err := os.WriteFile(input, []byte(sampleFile), 0600)
if err != nil {
t.Fatalf("failed to create a test file at %s", input)
}
Expand Down
4 changes: 2 additions & 2 deletions notes_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"io/ioutil"
"io"
"log"
"os"
"path/filepath"
Expand All @@ -12,7 +12,7 @@ import (
)

func TestNoteFilesDir_SaveNote(t *testing.T) {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
tmpDir := t.TempDir()
wantDate := time.Unix(1608463260, 0)

Expand Down

0 comments on commit 26f71de

Please sign in to comment.