Skip to content

Commit

Permalink
feat: parse formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
anpig committed Aug 19, 2023
1 parent f4880f9 commit bd34337
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/shell/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"

"github.com/willroberts/minecraft-client"
"github.com/anpig/mcfmt"
)

var (
Expand Down Expand Up @@ -56,6 +57,6 @@ func main() {
if err != nil {
log.Fatal("failed to send command:", err)
}
fmt.Println(resp.Body)
fmt.Println(mcfmt.Format(strings.TrimRight(resp.Body, "\n")))
}
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.19
require github.com/stretchr/testify v1.7.0

require (
github.com/anpig/mcfmt v0.0.0-20230819130242-70cf97a04b83 // indirect
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/anpig/mcfmt v0.0.0-20230819130242-70cf97a04b83 h1:sHyT3CW4jv5uZPLatD2sL1woULcPF4jk3iWLRzOTj/w=
github.com/anpig/mcfmt v0.0.0-20230819130242-70cf97a04b83/go.mod h1:BRS5/rZR3puXaZfqQCd0YTd6u1ZmZpqX6Ohavn1elJk=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down

0 comments on commit bd34337

Please sign in to comment.