latest
This commit is contained in:
parent
635f2650e9
commit
df4dbfdb1b
12
Makefile
12
Makefile
@ -19,21 +19,21 @@ lint:
|
|||||||
golangci-lint run
|
golangci-lint run
|
||||||
sh -c 'test -z "$$(gofmt -l .)"'
|
sh -c 'test -z "$$(gofmt -l .)"'
|
||||||
|
|
||||||
debug: ./$(FN)d
|
debug: ./$(FN)
|
||||||
DEBUG=1 GOTRACEBACK=all ./$(FN)d
|
DEBUG=1 GOTRACEBACK=all ./$(FN)d
|
||||||
|
|
||||||
debugger:
|
debugger:
|
||||||
cd cmd/$(FN)d && dlv debug main.go
|
cd cmd/$(FN) && dlv debug main.go
|
||||||
|
|
||||||
run: ./$(FN)d
|
run: ./$(FN)d
|
||||||
./$(FN)d
|
./$(FN)d
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f ./$(FN)d debug.log
|
-rm -f ./$(FN) debug.log
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
docker build --progress plain .
|
docker build --progress plain .
|
||||||
|
|
||||||
./$(FN)d: cmd/$(FN)d/main.go internal/*/*.go assets/*/*
|
./$(FN): cmd/$(FN)/main.go internal/*/*.go assets/*/*
|
||||||
cd ./cmd/$(FN)d && \
|
cd ./cmd/$(FN) && \
|
||||||
go build -o ../../$(FN)d $(GOFLAGS) .
|
go build -o ../../$(FN) $(GOFLAGS) .
|
||||||
|
@ -78,7 +78,7 @@ func (d *Database) Get() (*gorm.DB, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Database) Connect() error {
|
func (d *Database) Connect() error {
|
||||||
dsn := d.params.Config.DatabaseDSN
|
dsn := d.params.Config.DBDSN
|
||||||
if dsn == "" {
|
if dsn == "" {
|
||||||
err := errors.New("database DSN is empty")
|
err := errors.New("database DSN is empty")
|
||||||
d.log.Error().Err(err).Msg("failed to get database DSN from config")
|
d.log.Error().Err(err).Msg("failed to get database DSN from config")
|
||||||
@ -123,4 +123,3 @@ func (d *Database) Ping() error {
|
|||||||
d.log.Info().Msg("successfully pinged the database")
|
d.log.Info().Msg("successfully pinged the database")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user