mirror of
https://codeberg.org/scip/anydb.git
synced 2026-10-08 11:14:20 +02:00
update linter config, satisfy linter (#28)
This commit is contained in:
24
main.go
24
main.go
@@ -23,8 +23,8 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/inconshreveable/mousetrap"
|
||||
"codeberg.org/scip/anydb/cmd"
|
||||
"github.com/inconshreveable/mousetrap"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -34,30 +34,13 @@ func main() {
|
||||
Main()
|
||||
}
|
||||
|
||||
func init() {
|
||||
// if we're running on Windows AND if the user double clicked the
|
||||
// exe file from explorer, we tell them and then wait until any
|
||||
// key has been hit, which will make the cmd window disappear and
|
||||
// thus give the user time to read it.
|
||||
if runtime.GOOS == "windows" {
|
||||
if mousetrap.StartedByExplorer() {
|
||||
fmt.Println("Do no double click anydb.exe!")
|
||||
fmt.Println("Please open a command shell and run it from there.")
|
||||
fmt.Println()
|
||||
fmt.Print("Press any key to quit: ")
|
||||
_, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func Main() int {
|
||||
cmd.Execute()
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
// nolint gochecknoinits
|
||||
func init() {
|
||||
// if we're running on Windows AND if the user double clicked the
|
||||
// exe file from explorer, we tell them and then wait until any
|
||||
@@ -69,6 +52,7 @@ func init() {
|
||||
fmt.Println("Please open a command shell and run it from there.")
|
||||
fmt.Println()
|
||||
fmt.Print("Press any key to quit: ")
|
||||
|
||||
_, err := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user