:)
This commit is contained in:
parent
f301bfd90e
commit
e5e3c59521
|
@ -3,11 +3,8 @@ package storage
|
|||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/ectrc/snow/aid"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -29,15 +26,15 @@ func Asset(file string) (*[]byte) {
|
|||
}
|
||||
|
||||
func HttpAsset[T interface{}](file string) (*T) {
|
||||
client := http.Client{}
|
||||
// client := http.Client{}
|
||||
|
||||
resp, err := client.Get(aid.Config.API.Host + "/snow/httpassets/" + file)
|
||||
// resp, err := client.Get("https://raw.githubusercontent.com/ectrc/ectrc/main/" + file)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
// if err != nil {
|
||||
// return nil
|
||||
// }
|
||||
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
data, err := os.ReadFile("./data/" + file)
|
||||
// data, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user