summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-16 00:15:00 +0700
committerShulhan <ms@kilabit.info>2022-07-16 00:15:00 +0700
commit2e12fb11e048a3a0b247ec50028bb408f229db6b (patch)
tree31941a8a7194e26b7ad6486622ae49f0bb70494f
parent5710eacd62d53fa0f9088a50df6726b39eba2495 (diff)
downloadasciidoctor-go-2e12fb11e048a3a0b247ec50028bb408f229db6b.tar.xz
go.mod: set the minimum Go version to 1.18 and update share module
This changes replace any use of io/ioutil with os package.
-rw-r--r--document.go3
-rw-r--r--element_include.go4
-rw-r--r--go.mod4
-rw-r--r--go.sum17
4 files changed, 7 insertions, 21 deletions
diff --git a/document.go b/document.go
index 21a7ef1..b3ab500 100644
--- a/document.go
+++ b/document.go
@@ -7,7 +7,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"strconv"
@@ -93,7 +92,7 @@ func Open(file string) (doc *Document, err error) {
return nil, err
}
- raw, err := ioutil.ReadFile(file)
+ raw, err := os.ReadFile(file)
if err != nil {
return nil, fmt.Errorf("Open %s: %w", file, err)
}
diff --git a/element_include.go b/element_include.go
index f84e772..3a6a689 100644
--- a/element_include.go
+++ b/element_include.go
@@ -5,8 +5,8 @@ package asciidoctor
import (
"bytes"
- "io/ioutil"
"log"
+ "os"
"path/filepath"
)
@@ -40,7 +40,7 @@ func parseInclude(doc *Document, line []byte) (el *elementInclude) {
path = applySubstitutions(doc, path)
el.fpath = filepath.Join(filepath.Dir(doc.fpath), string(path))
- el.content, err = ioutil.ReadFile(el.fpath)
+ el.content, err = os.ReadFile(el.fpath)
if err != nil {
log.Printf("parseInclude %q: %s", doc.file, err)
return nil
diff --git a/go.mod b/go.mod
index 6480abd..e4bae23 100644
--- a/go.mod
+++ b/go.mod
@@ -3,8 +3,8 @@
module git.sr.ht/~shulhan/asciidoctor-go
-go 1.16
+go 1.18
-require github.com/shuLhan/share v0.35.0
+require github.com/shuLhan/share v0.39.0
//replace github.com/shuLhan/share => ../share
diff --git a/go.sum b/go.sum
index b29c8a6..c8c8346 100644
--- a/go.sum
+++ b/go.sum
@@ -1,15 +1,2 @@
-github.com/shuLhan/share v0.35.0 h1:dS6q3rBvCLWfUinjpzpzkyZWP8vaXVYiJ5gQQw4SrHk=
-github.com/shuLhan/share v0.35.0/go.mod h1:laKGR1DNboj8+INRIC9VFYRiVEu/IIjrLurUmTHXkw0=
-golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+github.com/shuLhan/share v0.39.0 h1:pga+HQqKeHgPiIs7b5sutf59uM/PsNqO2VlifZFKqTU=
+github.com/shuLhan/share v0.39.0/go.mod h1:1phZr6PX+8YLCOeNvx92J14/AV0mTo0Ebbc1SmzzYvk=