chore: make golangci-lint happy

This commit is contained in:
Steven
2022-08-24 21:53:12 +08:00
parent 0e4e2e4bc5
commit 7d0407013e
14 changed files with 130 additions and 35 deletions

View File

@ -3,7 +3,6 @@ package cmd
import (
"context"
"fmt"
"os"
"github.com/usememos/memos/server"
"github.com/usememos/memos/server/profile"
@ -41,8 +40,11 @@ func Run(profile *profile.Profile) error {
return s.Run()
}
func Execute() {
profile := profile.GetProfile()
func Execute() error {
profile, err := profile.GetProfile()
if err != nil {
return err
}
println("---")
println("profile")
@ -54,6 +56,8 @@ func Execute() {
if err := Run(profile); err != nil {
fmt.Printf("error: %+v\n", err)
os.Exit(1)
return err
}
return nil
}

View File

@ -1,7 +1,15 @@
package main
import "github.com/usememos/memos/bin/server/cmd"
import (
"os"
_ "github.com/mattn/go-sqlite3"
"github.com/usememos/memos/bin/server/cmd"
)
func main() {
cmd.Execute()
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}