Skip to content

Commit 17955b6

Browse files
committed
new
1 parent 300ae74 commit 17955b6

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

cmd/routes.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7-
"io/ioutil"
8-
"os"
9-
107
"github.com/drycc/controller-sdk-go/routes"
118
"github.com/olekukonko/tablewriter"
9+
"gopkg.in/yaml.v3"
10+
"io/ioutil"
11+
"os"
1212
)
1313

1414
// RoutesCreate create a route to an app.
@@ -146,7 +146,11 @@ func (d *DryccCmd) RoutesSet(appID string, name string, ruleFile string) error {
146146
if err != nil {
147147
return err
148148
}
149-
if err := json.Unmarshal(contents, &rules); err != nil {
149+
// if err := json.Unmarshal(contents, &rules); err != nil {
150+
// return err
151+
// }
152+
153+
if err := yaml.Unmarshal(contents, &rules); err != nil {
150154
return err
151155
}
152156

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ require (
2626
golang.org/x/text v0.7.0 // indirect
2727
)
2828

29-
replace github.com/drycc/controller-sdk-go => github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230517053503-b97a90682782
29+
replace github.com/drycc/controller-sdk-go => github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230524075627-dcfa3f6f1df1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm
1515
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
1616
github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo=
1717
github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
18-
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230517053503-b97a90682782 h1:eSLQNFi9Ws4mAqb1ZzkSB3UyTiF/xE44CZjYiI5NjXs=
19-
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230517053503-b97a90682782/go.mod h1:q6gbIO0f+xUM8mejPgbbUT8pdAYTIb5vugUsoTcbLw0=
18+
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230524075627-dcfa3f6f1df1 h1:uColqj3QFfLHTmhdNNsakhIl1JoB1kzrAa/6E3i1MeQ=
19+
github.com/jianxiaoguo/controller-sdk-go v0.0.0-20230524075627-dcfa3f6f1df1/go.mod h1:q6gbIO0f+xUM8mejPgbbUT8pdAYTIb5vugUsoTcbLw0=
2020
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
2121
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
2222
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=

0 commit comments

Comments
 (0)