mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 01:04:02 +03:00
Add tests for obfuscated2 clientside
This commit is contained in:
+2
-3
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user