mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: make golangci-lint
happy
This commit is contained in:
@@ -45,7 +45,7 @@ func checkDSN(dataDir string) (string, error) {
|
||||
}
|
||||
|
||||
// GetDevProfile will return a profile for dev or prod.
|
||||
func GetProfile() *Profile {
|
||||
func GetProfile() (*Profile, error) {
|
||||
profile := Profile{}
|
||||
flag.StringVar(&profile.Mode, "mode", "dev", "mode of server")
|
||||
flag.IntVar(&profile.Port, "port", 8080, "port of server")
|
||||
@@ -63,12 +63,12 @@ func GetProfile() *Profile {
|
||||
dataDir, err := checkDSN(profile.Data)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to check dsn: %s, err: %+v\n", dataDir, err)
|
||||
os.Exit(1)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
profile.Data = dataDir
|
||||
profile.DSN = fmt.Sprintf("%s/memos_%s.db", dataDir, profile.Mode)
|
||||
profile.Version = common.GetCurrentVersion(profile.Mode)
|
||||
|
||||
return &profile
|
||||
return &profile, nil
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ func (s *Server) registerTagRoutes(g *echo.Group) {
|
||||
|
||||
tagMapSet := make(map[string]bool)
|
||||
|
||||
r, err := regexp.Compile("#(.+?) ")
|
||||
r := regexp.MustCompile("#(.+?) ")
|
||||
if err != nil {
|
||||
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to compile regexp").SetInternal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user