Init GoReleaser (#27)
This commit is contained in:
parent
8081ffcb0f
commit
440b92a742
3 changed files with 28 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,5 @@
|
||||||
*.out
|
*.out
|
||||||
cover*
|
cover*
|
||||||
|
|
||||||
|
# goreleaser builds
|
||||||
|
dist/
|
||||||
|
|
23
.goreleaser.yml
Normal file
23
.goreleaser.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# This is an example .goreleaser.yml file with some sane defaults.
|
||||||
|
# Make sure to check the documentation at http://goreleaser.com
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod tidy
|
||||||
|
- go generate ./...
|
||||||
|
builds:
|
||||||
|
- env:
|
||||||
|
- CGO_ENABLED=0
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
- "386"
|
||||||
|
archives:
|
||||||
|
- replacements:
|
||||||
|
386: i386
|
||||||
|
amd64: x86_64
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ .Tag }}-next"
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewUserRepository(collection *mongo.Collection) UserRepository {
|
func NewUserRepository(collection *mongo.Collection) UserRepository {
|
||||||
|
@ -31,7 +32,7 @@ func (r *UserRepositoryMongo) FindByUsername(arg0 context.Context, arg1 string)
|
||||||
var entity UserModel
|
var entity UserModel
|
||||||
if err := r.collection.FindOne(arg0, bson.M{
|
if err := r.collection.FindOne(arg0, bson.M{
|
||||||
"username": arg1,
|
"username": arg1,
|
||||||
}).Decode(&entity); err != nil {
|
}, options.FindOne().SetSort(bson.M{})).Decode(&entity); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &entity, nil
|
return &entity, nil
|
||||||
|
|
Loading…
Reference in a new issue