Skip to content

Commit

Permalink
Use fully qualified Go module path (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
folliehiyuki committed Oct 12, 2022
1 parent 8b5a117 commit d58031c
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ builds:
env:
- CGO_ENABLED=0
binary: kroki
main: ./cmd/kroki/
goos:
- windows
- darwin
Expand Down
10 changes: 10 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ Similarly, you can also output to `stdout` when reading from a file using the sp

kroki convert simple.er --out-file -

== Installation

The https://github.com/yuzutech/kroki-cli/releases[releases page] provides binaries for each version to download.

You can also install the package directly from source. The compiled binary will be put into `$GOPATH/bin/` or `$HOME/go/bin/` if `$GOPATH` is not set:

```bash
go install github.com/yuzutech/kroki-cli/cmd/kroki@latest
```

== Configuration

To configure the endpoint, you can use a configuration file.
Expand Down
4 changes: 2 additions & 2 deletions main.go → cmd/kroki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

"kroki/cmd"
"github.com/yuzutech/kroki-cli/pkg"
)

var (
Expand All @@ -15,5 +15,5 @@ var (

func main() {
log.SetFlags(0)
cmd.Execute(version, commit)
pkg.Execute(version, commit)
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module kroki
module github.com/yuzutech/kroki-cli

go 1.18

Expand Down
4 changes: 2 additions & 2 deletions cmd/config.go → pkg/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import "github.com/spf13/viper"

Expand Down Expand Up @@ -30,4 +30,4 @@ func SetupConfig() {

func InitDefaultConfig() {
_ = viper.ReadInConfig() // ignore error
}
}
4 changes: 2 additions & 2 deletions cmd/convert.go → pkg/convert.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bufio"
Expand Down Expand Up @@ -227,4 +227,4 @@ func GetClient(cmd *cobra.Command) kroki.Client {
URL: viper.GetString("endpoint"),
Timeout: viper.GetDuration("timeout"),
})
}
}
4 changes: 2 additions & 2 deletions cmd/convert_test.go → pkg/convert_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bytes"
Expand Down Expand Up @@ -309,4 +309,4 @@ func CaptureOutput(f func()) string {
f()
_ = writer.Close()
return <-out
}
}
2 changes: 1 addition & 1 deletion cmd/decode.go → pkg/decode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion cmd/decode_test.go → pkg/decode_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions cmd/encode.go → pkg/encode.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bufio"
Expand Down Expand Up @@ -45,4 +45,4 @@ func EncodeFromFile(filePath string) {
exit(err)
}
fmt.Println(result)
}
}
2 changes: 1 addition & 1 deletion cmd/encode_test.go → pkg/encode_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion cmd/error.go → pkg/error.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go → pkg/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cmd
package pkg

import (
"fmt"
Expand Down

0 comments on commit d58031c

Please sign in to comment.