Skip to content

Commit

Permalink
goimports format
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphJACK committed Sep 16, 2023
1 parent 9043627 commit 11b7d3c
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 37 deletions.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"os"

"github.com/go-yaml/yaml"
uuid "github.com/satori/go.uuid"
"os"
)

type Config struct {
Expand Down
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package main
import (
"flag"
"fmt"
"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/services"
"log"
"os"
"runtime"
"runtime/pprof"
"time"

"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/services"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion meta/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package main

import (
"fmt"
"github.com/ProjectAnni/anniv-go/meta"
"os"

"github.com/ProjectAnni/anniv-go/meta"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion meta/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package meta

import (
"errors"
"github.com/pelletier/go-toml/v2"
"io/fs"
"log"
"os"
"os/exec"
"path"

"github.com/pelletier/go-toml/v2"
)

var albumIdx map[AlbumIdentifier]*AlbumDetails
Expand Down
3 changes: 2 additions & 1 deletion meta/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package meta

import (
"errors"
"github.com/go-git/go-git/v5"
"log"
"os"
"sync"
"time"

"github.com/go-git/go-git/v5"
)

var lock = &sync.RWMutex{}
Expand Down
3 changes: 2 additions & 1 deletion meta/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package meta

import (
"encoding/json"
"github.com/blevesearch/bleve/v2"
"log"
"sort"
"time"

"github.com/blevesearch/bleve/v2"
)

type trackDetails struct {
Expand Down
3 changes: 2 additions & 1 deletion model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package model

import (
"errors"
"time"

"github.com/ProjectAnni/anniv-go/meta"
"gorm.io/gorm"
"time"
)

type User struct {
Expand Down
3 changes: 2 additions & 1 deletion services/basics.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package services

import (
"net/http"

"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/meta"
"github.com/gin-gonic/gin"
"net/http"
)

type SiteInfo struct {
Expand Down
5 changes: 3 additions & 2 deletions services/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package services
import (
"errors"
"flag"
"log"
"os"

"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-contrib/static"
Expand All @@ -11,8 +14,6 @@ import (
"gorm.io/driver/postgres"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"os"
)

var db *gorm.DB
Expand Down
5 changes: 3 additions & 2 deletions services/favorite.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package services

import (
"net/http"
"strconv"

"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"net/http"
"strconv"
)

type AlbumFavForm struct {
Expand Down
5 changes: 3 additions & 2 deletions services/lyric.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package services

import (
"net/http"
"strconv"

"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"net/http"
"strconv"
)

func EndpointLyric(ng *gin.Engine) {
Expand Down
3 changes: 2 additions & 1 deletion services/meta.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package services

import (
"net/http"

"github.com/ProjectAnni/anniv-go/meta"
"github.com/gin-contrib/static"
"github.com/gin-gonic/gin"
"net/http"
)

func EndpointMeta(ng *gin.Engine) {
Expand Down
5 changes: 3 additions & 2 deletions services/middleware.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package services

import (
"net/http"
"time"

"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"github.com/pquerna/otp/totp"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"net/http"
"time"
)

func AuthRequired(ctx *gin.Context) {
Expand Down
3 changes: 2 additions & 1 deletion services/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package services

import (
"fmt"
"github.com/ProjectAnni/anniv-go/model"
"strconv"

"github.com/ProjectAnni/anniv-go/model"
)

type Response struct {
Expand Down
5 changes: 3 additions & 2 deletions services/search.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package services

import (
"net/http"
"strings"

"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)

type SearchResult struct {
Expand Down
9 changes: 5 additions & 4 deletions services/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package services
import (
"encoding/json"
"errors"
"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v4"
"math/rand"
"net/http"
"strconv"
"time"

"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v4"
)

type ShareEntry struct {
Expand Down
7 changes: 4 additions & 3 deletions services/stat.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package services

import (
"net/http"
"strconv"
"time"

"github.com/ProjectAnni/anniv-go/meta"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"net/http"
"strconv"
"time"
)

type SongPlayRecord struct {
Expand Down
3 changes: 2 additions & 1 deletion services/token.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package services

import (
"net/http"

"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v4"
uuid "github.com/satori/go.uuid"
"net/http"
)

type Token struct {
Expand Down
3 changes: 2 additions & 1 deletion services/twofactor.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package services

import (
"net/http"

"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
"github.com/pquerna/otp/totp"
"net/http"
)

func Endpoint2FA(ng *gin.Engine) {
Expand Down
13 changes: 7 additions & 6 deletions services/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import (
"bytes"
"encoding/json"
"errors"
"io"
"log"
"net/http"
"regexp"
"strconv"
"time"

"github.com/ProjectAnni/anniv-go/config"
"github.com/ProjectAnni/anniv-go/model"
"github.com/gin-gonic/gin"
Expand All @@ -12,12 +19,6 @@ import (
"golang.org/x/crypto/bcrypt"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"io"
"log"
"net/http"
"regexp"
"strconv"
"time"
)

var emailReg = regexp.MustCompile("^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)])$")
Expand Down

0 comments on commit 11b7d3c

Please sign in to comment.