forked from mirrors/homebox
chore: developer cleanup (#300)
* new PR tasks * add homebox to know words * formatting * bump deps * generate db models * ts errors * drop id * fix accessor * drop unused time field * change CI * add expected error * add type check * resolve serveral type errors * hoise in CI
This commit is contained in:
parent
88f9ff90d4
commit
bd321af29f
142 changed files with 817 additions and 1200 deletions
|
@ -4,10 +4,9 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/ardanlabs/conf/v3"
|
||||
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -55,7 +54,6 @@ func New() (*Config, error) {
|
|||
const prefix = "HBOX"
|
||||
|
||||
help, err := conf.Parse(prefix, &cfg)
|
||||
|
||||
if err != nil {
|
||||
if errors.Is(err, conf.ErrHelpWanted) {
|
||||
fmt.Println(help)
|
||||
|
@ -71,11 +69,9 @@ func New() (*Config, error) {
|
|||
// This is useful for debugging. If the marshaller errors out, it will panic.
|
||||
func (c *Config) Print() {
|
||||
res, err := json.MarshalIndent(c, "", " ")
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(string(res))
|
||||
|
||||
}
|
||||
|
|
|
@ -36,5 +36,4 @@ func Test_MailerReady_Failure(t *testing.T) {
|
|||
|
||||
mc.From = "from"
|
||||
assert.True(t, mc.Ready())
|
||||
|
||||
}
|
||||
|
|
|
@ -5,8 +5,7 @@ import (
|
|||
"errors"
|
||||
)
|
||||
|
||||
type UnauthorizedError struct {
|
||||
}
|
||||
type UnauthorizedError struct{}
|
||||
|
||||
func (err *UnauthorizedError) Error() string {
|
||||
return "unauthorized"
|
||||
|
|
|
@ -14,7 +14,6 @@ func init() {
|
|||
// FieldErrors array and returned.
|
||||
func Check(val any) error {
|
||||
err := validate.Struct(val)
|
||||
|
||||
if err != nil {
|
||||
verrors, ok := err.(validator.ValidationErrors)
|
||||
if !ok {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue