From aef9ab5273efb6aac9da08318fc926a43a6acc9c Mon Sep 17 00:00:00 2001 From: Tim Voronov Date: Tue, 28 Mar 2023 15:11:06 -0400 Subject: [PATCH] Updated dependencies (#12) * Updated dependencies * Fxied linting issues --- Dockerfile | 2 +- Dockerfile.release | 2 +- go.mod | 24 ++++++++++---------- go.sum | 55 +++++++++++++++++++++++----------------------- sources/fs.go | 5 ++--- sources/fs_test.go | 49 ++++++++++++++++++++--------------------- sources/git.go | 4 ++-- sources/http.go | 4 ++-- 8 files changed, 72 insertions(+), 73 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6f63af..850f954 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ COPY . . RUN CGO_ENABLED=0 GOOS=linux make compile # Build the final container. And install -FROM montferret/chromium:110.0.5479.0 +FROM montferret/chromium:111.0.5563.0 RUN apt-get update && apt-get install -y dumb-init diff --git a/Dockerfile.release b/Dockerfile.release index 16256fe..e1d0aa7 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -1,5 +1,5 @@ # Build the final container. And install -FROM montferret/chromium:110.0.5479.0 +FROM montferret/chromium:111.0.5563.0 RUN apt-get update && apt-get install -y dumb-init diff --git a/go.mod b/go.mod index e158175..a984439 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/MontFerret/lab go 1.19 require ( - github.com/MontFerret/ferret v0.17.0 + github.com/MontFerret/ferret v0.18.0 github.com/go-git/go-billy/v5 v5.4.1 - github.com/go-git/go-git/v5 v5.6.0 + github.com/go-git/go-git/v5 v5.6.1 github.com/go-waitfor/waitfor v1.0.0 github.com/go-waitfor/waitfor-http v1.0.0 github.com/gobwas/glob v0.2.3 @@ -15,19 +15,19 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.29.0 github.com/smartystreets/goconvey v1.7.2 - github.com/urfave/cli/v2 v2.25.0 + github.com/urfave/cli/v2 v2.25.1 gopkg.in/yaml.v2 v2.4.0 ) require ( github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect - github.com/PuerkitoBio/goquery v1.8.0 // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/PuerkitoBio/goquery v1.8.1 // indirect + github.com/acomagu/bufpipe v1.0.4 // indirect github.com/andybalholm/cascadia v1.3.1 // indirect github.com/antchfx/htmlquery v1.3.0 // indirect - github.com/antchfx/xpath v1.2.3 // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12 // indirect + github.com/antchfx/xpath v1.2.4 // indirect + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cloudflare/circl v1.1.0 // indirect github.com/corpix/uarand v0.2.0 // indirect @@ -45,7 +45,7 @@ require ( github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/labstack/gommon v0.4.0 // indirect - github.com/mafredri/cdp v0.33.0 // indirect + github.com/mafredri/cdp v0.34.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -61,10 +61,10 @@ require ( github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect golang.org/x/time v0.3.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) diff --git a/go.sum b/go.sum index 95fd728..4dfee82 100644 --- a/go.sum +++ b/go.sum @@ -1,23 +1,24 @@ github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/MontFerret/ferret v0.17.0 h1:41DhD44IX6n0bkV1i0HMrw+IhRd07A3OQOGdkSEjstA= -github.com/MontFerret/ferret v0.17.0/go.mod h1:sNYmrZu9TAeb4k5+iitdQh1BSy1ISZV6+e7vgU6Y1Og= -github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I= -github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= -github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= -github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/MontFerret/ferret v0.18.0 h1:ptRMg1Yf8IIFMYWKowUTHvTjKU5eMXlio4TZX2kj15Y= +github.com/MontFerret/ferret v0.18.0/go.mod h1:SkC/sWiBp9jMy0aChIKr+s0lB+gFs0KJQi8ms/2FcR4= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= +github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= +github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antchfx/htmlquery v1.3.0 h1:5I5yNFOVI+egyia5F2s/5Do2nFWxJz41Tr3DyfKD25E= github.com/antchfx/htmlquery v1.3.0/go.mod h1:zKPDVTMhfOmcwxheXUsx4rKJy8KEY/PU6eXr/2SebQ8= -github.com/antchfx/xpath v1.2.3 h1:CCZWOzv5bAqjVv0offZ2LVgVYFbeldKQVuLNbViZdes= github.com/antchfx/xpath v1.2.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12 h1:npHgfD4Tl2WJS3AJaMUi5ynGDPUBfkg3U3fCzDyXZ+4= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antchfx/xpath v1.2.4 h1:dW1HB/JxKvGtJ9WyVGJ0sIoEcqftV3SqIstujI+B9XY= +github.com/antchfx/xpath v1.2.4/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 h1:X8MJ0fnN5FPdcGF5Ij2/OW+HgiJrRg3AfHAx1PJtIzM= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= @@ -44,13 +45,12 @@ github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4x github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.4.0/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= github.com/go-git/go-git-fixtures/v4 v4.3.1 h1:y5z6dd3qi8Hl+stezc8p3JxDkoTRqMAlKnXHuzrfjTQ= github.com/go-git/go-git-fixtures/v4 v4.3.1/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo= -github.com/go-git/go-git/v5 v5.6.0 h1:JvBdYfcttd+0kdpuWO7KTu0FYgCf5W0t5VwkWGobaa4= -github.com/go-git/go-git/v5 v5.6.0/go.mod h1:6nmJ0tJ3N4noMV1Omv7rC5FG3/o8Cm51TB4CJp7mRmE= +github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk= +github.com/go-git/go-git/v5 v5.6.1/go.mod h1:mvyoL6Unz0PiTQrGQfSfiLFhBH1c1e84ylC2MDs4ee8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -117,8 +117,8 @@ github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/mafredri/cdp v0.33.0 h1:McuQjNe0DyctTUxt8zY6jGTlpPoy2gciqxtvKhz0XPM= -github.com/mafredri/cdp v0.33.0/go.mod h1:Dbsh7eY/zhQlsddEDWzZGOztv9Jf2gzKq47M7a2P3C4= +github.com/mafredri/cdp v0.34.0 h1:kC8LFc1IJcjexESrt6U+MkqLtbwLV+WQ9hgcn1hntc4= +github.com/mafredri/cdp v0.34.0/go.mod h1:Dbsh7eY/zhQlsddEDWzZGOztv9Jf2gzKq47M7a2P3C4= github.com/mafredri/go-lint v0.0.0-20180911205320-920981dfc79e/go.mod h1:k/zdyxI3q6dup24o8xpYjJKTCf2F7rfxLp6w/efTiWs= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -167,11 +167,11 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli/v2 v2.25.0 h1:ykdZKuQey2zq0yin/l7JOm9Mh+pg72ngYMeB0ABn6q8= -github.com/urfave/cli/v2 v2.25.0/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= +github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw= +github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= @@ -194,7 +194,6 @@ golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= @@ -213,10 +212,11 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -247,18 +247,18 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/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/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -266,8 +266,9 @@ 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/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/sources/fs.go b/sources/fs.go index c08cc9f..ffafe49 100644 --- a/sources/fs.go +++ b/sources/fs.go @@ -2,7 +2,6 @@ package sources import ( "context" - "io/ioutil" "net/url" "os" "path/filepath" @@ -129,7 +128,7 @@ func (fs *FileSystem) traverse(ctx context.Context, path string, onNext chan<- F return } - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { onError <- NewErrorFrom(path, err) @@ -160,7 +159,7 @@ func (fs *FileSystem) traverse(ctx context.Context, path string, onNext chan<- F } func (fs *FileSystem) readFile(filename string, onNext chan<- File, onError chan<- Error) { - content, err := ioutil.ReadFile(filename) + content, err := os.ReadFile(filename) if err != nil { onError <- NewErrorFrom(filename, err) diff --git a/sources/fs_test.go b/sources/fs_test.go index 9f68b95..9cbc270 100644 --- a/sources/fs_test.go +++ b/sources/fs_test.go @@ -3,7 +3,6 @@ package sources_test import ( "context" "fmt" - "io/ioutil" "net/url" "os" "path/filepath" @@ -44,7 +43,7 @@ func TestFileSystem(t *testing.T) { Convey("When a single file passed", func() { Convey("Should read content if .fql", func() { - file, err := ioutil.TempFile("", "lab.*.fql") + file, err := os.CreateTemp("", "lab.*.fql") So(err, ShouldBeNil) @@ -76,7 +75,7 @@ func TestFileSystem(t *testing.T) { }) Convey("Should return error if not .fql", func() { - file, err := ioutil.TempFile("", "lab.*.aql") + file, err := os.CreateTemp("", "lab.*.aql") So(err, ShouldBeNil) @@ -112,7 +111,7 @@ func TestFileSystem(t *testing.T) { files := make([]string, 5) for i := range files { - f, err := ioutil.TempFile("", "lab.*.fql") + f, err := os.CreateTemp("", "lab.*.fql") if err != nil { panic(err) @@ -158,7 +157,7 @@ func TestFileSystem(t *testing.T) { Convey("Should filter out files", func() { files := make([]string, 5) - dir, err := ioutil.TempDir("", "lab_test") + dir, err := os.MkdirTemp("", "lab_test") if err != nil { panic(err) @@ -171,7 +170,7 @@ func TestFileSystem(t *testing.T) { name = "lab.*.take.fql" } - f, err := ioutil.TempFile(dir, name) + f, err := os.CreateTemp(dir, name) if err != nil { panic(err) @@ -236,14 +235,14 @@ func TestFileSystem(t *testing.T) { Convey(".Resolve", func() { Convey("When a local file passed", func() { Convey("Should resolve a file from the same folder", func() { - f1, err := ioutil.TempFile("", "lab.*.fql") + f1, err := os.CreateTemp("", "lab.*.fql") So(err, ShouldBeNil) _, err = f1.WriteString("RETURN 'file1'") So(err, ShouldBeNil) So(f1.Close(), ShouldBeNil) - f2, err := ioutil.TempFile("", "lab.*.fql") + f2, err := os.CreateTemp("", "lab.*.fql") So(err, ShouldBeNil) _, err = f2.WriteString("RETURN 'file2'") @@ -287,17 +286,17 @@ func TestFileSystem(t *testing.T) { }) Convey("Should resolve a file from a different folder", func() { - dir, err := ioutil.TempDir("", "lab-tests") + dir, err := os.MkdirTemp("", "lab-tests") So(err, ShouldBeNil) - f1, err := ioutil.TempFile("", "lab.*.fql") + f1, err := os.CreateTemp("", "lab.*.fql") So(err, ShouldBeNil) _, err = f1.WriteString("RETURN 'file1'") So(err, ShouldBeNil) So(f1.Close(), ShouldBeNil) - f2, err := ioutil.TempFile(dir, "lab.*.fql") + f2, err := os.CreateTemp(dir, "lab.*.fql") So(err, ShouldBeNil) _, err = f2.WriteString("RETURN 'file2'") @@ -349,20 +348,20 @@ func TestFileSystem(t *testing.T) { }) Convey("Should resolve a file from a sibling folder", func() { - dir1, err := ioutil.TempDir("", "lab-tests-*") + dir1, err := os.MkdirTemp("", "lab-tests-*") So(err, ShouldBeNil) - dir2, err := ioutil.TempDir("", "lab-tests-*") + dir2, err := os.MkdirTemp("", "lab-tests-*") So(err, ShouldBeNil) - f1, err := ioutil.TempFile(dir1, "lab.*.fql") + f1, err := os.CreateTemp(dir1, "lab.*.fql") So(err, ShouldBeNil) _, err = f1.WriteString("RETURN 'file1'") So(err, ShouldBeNil) So(f1.Close(), ShouldBeNil) - f2, err := ioutil.TempFile(dir2, "lab.*.fql") + f2, err := os.CreateTemp(dir2, "lab.*.fql") So(err, ShouldBeNil) _, err = f2.WriteString("RETURN 'file2'") @@ -414,20 +413,20 @@ func TestFileSystem(t *testing.T) { }) Convey("Should resolve a file using only rel paths", func() { - dir1, err := ioutil.TempDir("", "lab-tests-*") + dir1, err := os.MkdirTemp("", "lab-tests-*") So(err, ShouldBeNil) - dir2, err := ioutil.TempDir("", "lab-tests-*") + dir2, err := os.MkdirTemp("", "lab-tests-*") So(err, ShouldBeNil) - f1, err := ioutil.TempFile(dir1, "lab.*.fql") + f1, err := os.CreateTemp(dir1, "lab.*.fql") So(err, ShouldBeNil) _, err = f1.WriteString("RETURN 'file1'") So(err, ShouldBeNil) So(f1.Close(), ShouldBeNil) - f2, err := ioutil.TempFile(dir2, "lab.*.fql") + f2, err := os.CreateTemp(dir2, "lab.*.fql") So(err, ShouldBeNil) _, err = f2.WriteString("RETURN 'file2'") @@ -485,26 +484,26 @@ func TestFileSystem(t *testing.T) { }) Convey("Should resolve from a path different from a based one", func() { - dirTestsRoot, err := ioutil.TempDir("", "lab-tests-test-root-*") + dirTestsRoot, err := os.MkdirTemp("", "lab-tests-test-root-*") So(err, ShouldBeNil) - dirTestsNested, err := ioutil.TempDir(dirTestsRoot, "lab-tests-test-nested-*") + dirTestsNested, err := os.MkdirTemp(dirTestsRoot, "lab-tests-test-nested-*") So(err, ShouldBeNil) - dirTestsNested2x, err := ioutil.TempDir(dirTestsNested, "lab-tests-test-nested-2x-*") + dirTestsNested2x, err := os.MkdirTemp(dirTestsNested, "lab-tests-test-nested-2x-*") So(err, ShouldBeNil) - dirExmRoot, err := ioutil.TempDir("", "lab-tests-examples-root-*") + dirExmRoot, err := os.MkdirTemp("", "lab-tests-examples-root-*") So(err, ShouldBeNil) - f1, err := ioutil.TempFile(dirExmRoot, "lab.*.fql") + f1, err := os.CreateTemp(dirExmRoot, "lab.*.fql") So(err, ShouldBeNil) _, err = f1.WriteString("RETURN 'file1'") So(err, ShouldBeNil) So(f1.Close(), ShouldBeNil) - f2, err := ioutil.TempFile(dirTestsNested2x, "lab.*.yaml") + f2, err := os.CreateTemp(dirTestsNested2x, "lab.*.yaml") So(err, ShouldBeNil) f2Content := fmt.Sprintf(` diff --git a/sources/git.go b/sources/git.go index 7ecdbb4..399abaf 100644 --- a/sources/git.go +++ b/sources/git.go @@ -3,7 +3,7 @@ package sources import ( "context" "errors" - "io/ioutil" + "io" "net/url" "path/filepath" "sync" @@ -113,7 +113,7 @@ func (g *Git) Read(ctx context.Context) (<-chan File, <-chan Error) { defer reader.Close() - content, err := ioutil.ReadAll(reader) + content, err := io.ReadAll(reader) if err != nil { onError <- NewErrorFrom(f.Name, err) diff --git a/sources/http.go b/sources/http.go index 9d13a2c..1c6e206 100644 --- a/sources/http.go +++ b/sources/http.go @@ -2,7 +2,7 @@ package sources import ( "context" - "io/ioutil" + "io" "net/url" "github.com/hashicorp/go-retryablehttp" @@ -56,7 +56,7 @@ func (src *HTTP) call(ctx context.Context, u *url.URL) (<-chan File, <-chan Erro defer res.Body.Close() - content, err := ioutil.ReadAll(res.Body) + content, err := io.ReadAll(res.Body) if err != nil { onError <- NewErrorFrom(u.String(), err)