Fix linting errors

This commit is contained in:
eikendev 2021-06-11 00:11:30 +02:00
parent 27c65921d9
commit 628d96bdb7
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
5 changed files with 6 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,4 +1,4 @@
app out/
*.db *.db
config.yml config.yml

View file

@ -2,7 +2,8 @@ IMAGE := eikendev/pushbits
.PHONY: build .PHONY: build
build: build:
go build -ldflags="-w -s" -o app ./cmd/pushbits mkdir -p ./out
go build -ldflags="-w -s" -o ./out/pushbits ./cmd/pushbits
.PHONY: test .PHONY: test
test: test:

View file

@ -47,7 +47,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
dp, err := dispatcher.Create(db, c.Matrix.Homeserver, c.Matrix.Username, c.Matrix.Password, c.Formatting) dp, err := dispatcher.Create(c.Matrix.Homeserver, c.Matrix.Username, c.Matrix.Password, c.Formatting)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View file

@ -14,7 +14,7 @@ func (m *Manager) CreatePasswordHash(password string) ([]byte, error) {
if err != nil { if err != nil {
return []byte{}, errors.New("HIBP is not available, please wait until service is available again") return []byte{}, errors.New("HIBP is not available, please wait until service is available again")
} else if pwned { } else if pwned {
return []byte{}, errors.New("Password is pwned, please choose another one") return []byte{}, errors.New("password is pwned, please choose another one")
} }
} }

View file

@ -11,19 +11,14 @@ var (
loginType = "m.login.password" loginType = "m.login.password"
) )
// The Database interface for encapsulating database access.
type Database interface {
}
// Dispatcher holds information for sending notifications to clients. // Dispatcher holds information for sending notifications to clients.
type Dispatcher struct { type Dispatcher struct {
db Database
client *gomatrix.Client client *gomatrix.Client
formatting configuration.Formatting formatting configuration.Formatting
} }
// Create instanciates a dispatcher connection. // Create instanciates a dispatcher connection.
func Create(db Database, homeserver, username, password string, formatting configuration.Formatting) (*Dispatcher, error) { func Create(homeserver, username, password string, formatting configuration.Formatting) (*Dispatcher, error) {
log.Println("Setting up dispatcher.") log.Println("Setting up dispatcher.")
client, err := gomatrix.NewClient(homeserver, "", "") client, err := gomatrix.NewClient(homeserver, "", "")