Skip to content

Commit

Permalink
Update dependencies, Go version used
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom committed Feb 23, 2024
1 parent 192325f commit 628b316
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-go@v1
- uses: actions/setup-go@v5
with:
go-version: '1.18.x'
go-version: 'stable'
- uses: actions/checkout@v4
- name: Get dependencies
run: go mod download
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d
github.com/dyatlov/go-opengraph v0.0.0-20210112100619-dae8665a5b09
github.com/golang/snappy v0.0.4
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47
golang.org/x/net v0.21.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)

require (
github.com/gobwas/glob v0.2.3 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/text v0.14.0 // indirect
)

go 1.18
go 1.22
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8 h1:YVvt637ygnOO9qjLBVmPOvrUmCz/i8YECSu/8UlOQW0=
github.com/gomarkdown/markdown v0.0.0-20220310201231-552c6011c0b8/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47 h1:k4Tw0nt6lwro3Uin8eqoET7MDA4JnT8YgbCjc/g5E3k=
github.com/gomarkdown/markdown v0.0.0-20231222211730-1d6d20845b47/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
8 changes: 4 additions & 4 deletions html_meta_parser_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package unfurlist

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

Expand All @@ -12,7 +12,7 @@ func TestExtractData_explicitCharset(t *testing.T) {
// parameter from Content-Type header
//
// [1]: https://html.spec.whatwg.org/multipage/syntax.html#determining-the-character-encoding
data, err := ioutil.ReadFile("testdata/no-charset-in-first-1024bytes")
data, err := os.ReadFile("testdata/no-charset-in-first-1024bytes")
if err != nil {
t.Fatal(err)
}
Expand All @@ -27,7 +27,7 @@ func TestExtractData_explicitCharset(t *testing.T) {
}

func TestExtractData_multibyte1(t *testing.T) {
data, err := ioutil.ReadFile("testdata/korean")
data, err := os.ReadFile("testdata/korean")
if err != nil {
t.Fatal(err)
}
Expand All @@ -42,7 +42,7 @@ func TestExtractData_multibyte1(t *testing.T) {
}

func TestExtractData_multibyte2(t *testing.T) {
data, err := ioutil.ReadFile("testdata/japanese")
data, err := os.ReadFile("testdata/japanese")
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions remote-data-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main
import (
"encoding/json"
"flag"
"io/ioutil"
"io"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -66,7 +66,7 @@ func main() {
if r.StatusCode >= 400 {
log.Fatal(v, r.Status)
}
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
if err != nil {
log.Fatal(v, err)
}
Expand Down
33 changes: 16 additions & 17 deletions unfurlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
//
// Example:
//
// ?content=Check+this+out+https://www.youtube.com/watch?v=dQw4w9WgXcQ
// ?content=Check+this+out+https://www.youtube.com/watch?v=dQw4w9WgXcQ
//
// Will return:
//
// Type: "application/json"
// Type: "application/json"
//
// [
// {
// "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
// "title": "Rick Astley - Never Gonna Give You Up (Video)",
// "url_type": "video.other",
// "description": "Rick Astley - Never Gonna Give You Up...",
// "site_name": "YouTube",
// "favicon": "https://www.youtube.com/yts/img/favicon_32-vflOogEID.png",
// "image": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg"
// }
// ]
// [
// {
// "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
// "title": "Rick Astley - Never Gonna Give You Up (Video)",
// "url_type": "video.other",
// "description": "Rick Astley - Never Gonna Give You Up...",
// "site_name": "YouTube",
// "favicon": "https://www.youtube.com/yts/img/favicon_32-vflOogEID.png",
// "image": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg"
// }
// ]
//
// If handler was configured with FetchImageSize=true in its config, each hash
// may have additional fields `image_width` and `image_height` specifying
Expand All @@ -40,7 +40,7 @@
// provided content is parsed as markdown formatted text and links are extracted
// in context-aware mode — i.e. preformatted text blocks are skipped.
//
// Security
// # Security
//
// Care should be taken when running this inside internal network since it may
// disclose internal endpoints. It is a good idea to run the service on
Expand Down Expand Up @@ -69,7 +69,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
Expand Down Expand Up @@ -203,7 +202,7 @@ func New(conf ...ConfFunc) http.Handler {
h.MaxBodyChunkSize = defaultMaxBodyChunkSize
}
if h.Log == nil {
h.Log = log.New(ioutil.Discard, "", 0)
h.Log = log.New(io.Discard, "", 0)
}
if h.oembedLookupFunc == nil {
fn, err := oembed.Providers(bytes.NewReader(providersData))
Expand Down Expand Up @@ -482,7 +481,7 @@ func (h *unfurlHandler) fetchData(ctx context.Context, URL string) (*pageChunk,
return nil, err
}
}
head, err := ioutil.ReadAll(io.LimitReader(resp.Body, h.MaxBodyChunkSize))
head, err := io.ReadAll(io.LimitReader(resp.Body, h.MaxBodyChunkSize))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 628b316

Please sign in to comment.