Add tests for obfuscated2 clientside

This commit is contained in:
9seconds
2021-03-22 11:34:32 +03:00
parent 4d2d21e101
commit 69203f3e23
21 changed files with 320 additions and 22 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
@@ -123,11 +122,11 @@ func (c *Access) getIP(protocol string) net.IP {
}
defer func() {
io.Copy(ioutil.Discard, resp.Body) // nolint: errcheck
io.Copy(io.Discard, resp.Body) // nolint: errcheck
resp.Body.Close()
}()
data, err := ioutil.ReadAll(resp.Body)
data, err := io.ReadAll(resp.Body)
if err != nil {
return nil
}
+2 -2
View File
@@ -2,9 +2,9 @@ package cli
import (
"fmt"
"io/ioutil"
"net"
"net/url"
"os"
"github.com/9seconds/mtg/v2/config"
"github.com/9seconds/mtg/v2/mtglib"
@@ -19,7 +19,7 @@ type base struct {
}
func (b *base) ReadConfig(version string) error {
content, err := ioutil.ReadFile(b.ConfigPath)
content, err := os.ReadFile(b.ConfigPath)
if err != nil {
return fmt.Errorf("cannot read config file: %w", err)
}