Skip to content
Permalink
Browse files

chore: update goimports for cname

  • Loading branch information...
moul committed Apr 25, 2019
1 parent 53c1963 commit 248e8be52eeb3579a6cef43e774b0da915b97e79
Showing with 15 additions and 7 deletions.
  1. +1 −1 entity/entity.go
  2. +1 −1 go.mod
  3. +1 −1 hypervisor/util.go
  4. +1 −1 pwctl/config/config.go
  5. +1 −1 pwctl/main.go
  6. +1 −1 server/server.go
  7. +8 −0 server/svc.go
  8. +1 −1 sql/sql.go
@@ -1,4 +1,4 @@
package entity
package entity // import "pathwar.pw/entity"

func ByName(name string) interface{} {
return AllMap()[name]
2 go.mod
@@ -40,7 +40,7 @@ require (
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
google.golang.org/appengine v1.2.0 // indirect
google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275 // indirect
google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275
google.golang.org/grpc v1.17.0
gotest.tools v0.0.0-20181223230014-1083505acf35 // indirect
moul.io/zapgorm v0.0.0-20181220094309-2149c5ded6fc
@@ -1,4 +1,4 @@
package hypervisor
package hypervisor // import "pathwar.pw/hypervisor"

import "math/rand"

@@ -1,4 +1,4 @@
package config
package config // import "pathwar.pw/pwctl/config"

import "encoding/json"

@@ -1,4 +1,4 @@
package main
package main // import "pathwar.pw/pwctl"

import (
"encoding/json"
@@ -1,4 +1,4 @@
package server
package server // import "pathwar.pw/server"

import (
"context"
@@ -8,6 +8,7 @@ import (
"github.com/jinzhu/gorm"
"github.com/moul/gofakeit"
"github.com/pkg/errors"
"go.uber.org/zap"

"pathwar.pw/entity"
"pathwar.pw/sql"
@@ -130,26 +131,31 @@ func (s *svc) GenerateFakeData(ctx context.Context, _ *Void) (*Void, error) {
}
tournaments[0].IsDefault = true

zap.L().Debug("Generating hypervisors")
for _, entity := range hypervisors {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
}
}
zap.L().Debug("Generating users")
for _, entity := range users {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
}
}
zap.L().Debug("Generating levels")
for _, entity := range levels {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
}
}
zap.L().Debug("Generating tournaments")
for _, entity := range tournaments {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
}
}
zap.L().Debug("Generating teams")
for _, entity := range teams {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
@@ -181,11 +187,13 @@ func (s *svc) GenerateFakeData(ctx context.Context, _ *Void) (*Void, error) {
}
}

zap.L().Debug("Generating memberships")
for _, entity := range memberships {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
}
}
zap.L().Debug("Generating coupons")
for _, entity := range coupons {
if err := s.db.Set("gorm:association_autoupdate", true).Create(entity).Error; err != nil {
return nil, err
@@ -1,4 +1,4 @@
package sql
package sql // import "pathwar.pw/sql"

import (
"encoding/base64"

0 comments on commit 248e8be

Please sign in to comment.
You can’t perform that action at this time.