Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Dec 15, 2024
1 parent fe4f0d6 commit 1fdc86c
Show file tree
Hide file tree
Showing 37 changed files with 75 additions and 54 deletions.
4 changes: 2 additions & 2 deletions cmd/web/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
package main

import (
"github.com/TheTNB/panel/internal/http/middleware"
"github.com/TheTNB/panel/internal/job"
"github.com/google/wire"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/bootstrap"
"github.com/TheTNB/panel/internal/data"
"github.com/TheTNB/panel/internal/http/middleware"
"github.com/TheTNB/panel/internal/job"
"github.com/TheTNB/panel/internal/route"
"github.com/TheTNB/panel/internal/service"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/biz/database_server.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package biz

import (
"github.com/TheTNB/panel/internal/app"
"github.com/go-rat/utils/crypt"
"time"

"github.com/go-rat/utils/crypt"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/http/request"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/biz/database_user.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package biz

import (
"github.com/TheTNB/panel/internal/app"
"github.com/go-rat/utils/crypt"
"time"

"github.com/go-rat/utils/crypt"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/http/request"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/biz/ssh.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package biz

import (
"github.com/TheTNB/panel/internal/app"
"github.com/go-rat/utils/crypt"
"time"

"github.com/go-rat/utils/crypt"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/ssh"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/bootstrap/cron.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package bootstrap

import (
"github.com/TheTNB/panel/internal/job"
"log/slog"

"github.com/knadh/koanf/v2"
"github.com/robfig/cron/v3"

"github.com/TheTNB/panel/internal/job"
pkgcron "github.com/TheTNB/panel/pkg/cron"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/bootstrap/db.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package bootstrap

import (
"github.com/knadh/koanf/v2"
"log/slog"
"path/filepath"

"github.com/glebarez/sqlite"
"github.com/go-gormigrate/gormigrate/v2"
"github.com/knadh/koanf/v2"
slogGorm "github.com/orandin/slog-gorm"
"gorm.io/gorm"

Expand Down
5 changes: 3 additions & 2 deletions internal/bootstrap/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package bootstrap

import (
"crypto/tls"
"log/slog"
"net/http"

"github.com/bddjr/hlfhr"
"github.com/go-chi/chi/v5"
"github.com/go-rat/sessions"
"github.com/knadh/koanf/v2"
"gorm.io/gorm"
"log/slog"
"net/http"

"github.com/TheTNB/panel/internal/http/middleware"
"github.com/TheTNB/panel/internal/route"
Expand Down
5 changes: 3 additions & 2 deletions internal/bootstrap/logger.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package bootstrap

import (
"github.com/knadh/koanf/v2"
"log/slog"
"path/filepath"

"github.com/TheTNB/panel/internal/app"
"github.com/knadh/koanf/v2"
"gopkg.in/natefinch/lumberjack.v2"

"github.com/TheTNB/panel/internal/app"
)

func NewLog(conf *koanf.Koanf) *slog.Logger {
Expand Down
2 changes: 1 addition & 1 deletion internal/data/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/json"
"errors"
"fmt"
"gorm.io/gorm"
"slices"

"github.com/expr-lang/expr"
"github.com/go-rat/utils/collect"
"github.com/hashicorp/go-version"
"github.com/spf13/cast"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
Expand Down
2 changes: 1 addition & 1 deletion internal/data/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package data
import (
"errors"
"fmt"
"gorm.io/gorm"
"os"
"path/filepath"
"slices"
"strings"
"time"

"github.com/shirou/gopsutil/disk"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
Expand Down
3 changes: 2 additions & 1 deletion internal/data/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"context"
"errors"
"fmt"
"gorm.io/gorm"
"slices"
"strings"
"time"

"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
Expand Down
5 changes: 3 additions & 2 deletions internal/data/cert_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"context"
"errors"
"fmt"
"gorm.io/gorm"
"time"

"github.com/go-resty/resty/v2"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/acme"
"github.com/TheTNB/panel/pkg/cert"
"github.com/go-resty/resty/v2"
)

type certAccountRepo struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/data/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"strings"
"time"

"github.com/go-resty/resty/v2"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/types"
"github.com/TheTNB/panel/pkg/types/docker/container"
"github.com/go-resty/resty/v2"
)

type containerRepo struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/data/container_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"strings"
"time"

"github.com/go-resty/resty/v2"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/tools"
"github.com/TheTNB/panel/pkg/types"
"github.com/TheTNB/panel/pkg/types/docker/image"
"github.com/go-resty/resty/v2"
)

type containerImageRepo struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/data/container_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"strings"
"time"

"github.com/go-resty/resty/v2"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/types"
"github.com/TheTNB/panel/pkg/types/docker/network"
"github.com/go-resty/resty/v2"
)

type containerNetworkRepo struct {
Expand Down
3 changes: 2 additions & 1 deletion internal/data/container_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"strings"
"time"

"github.com/go-resty/resty/v2"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/tools"
"github.com/TheTNB/panel/pkg/types"
"github.com/TheTNB/panel/pkg/types/docker/volume"
"github.com/go-resty/resty/v2"
)

type containerVolumeRepo struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/data/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ package data
import (
"errors"
"fmt"
"gorm.io/gorm"
"path/filepath"
"strconv"
"time"

"github.com/go-rat/utils/str"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/io"
"github.com/TheTNB/panel/pkg/os"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/systemctl"
"github.com/go-rat/utils/str"
)

type cronRepo struct {
Expand Down
5 changes: 3 additions & 2 deletions internal/data/database_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package data

import (
"fmt"
"github.com/TheTNB/panel/internal/app"
"gorm.io/gorm"
"log/slog"
"slices"

"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/db"
Expand Down
2 changes: 1 addition & 1 deletion internal/data/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package data

import (
"errors"
"gorm.io/gorm"
"time"

"github.com/spf13/cast"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
Expand Down
2 changes: 1 addition & 1 deletion internal/data/safe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package data

import (
"fmt"
"github.com/TheTNB/panel/pkg/os"
"strings"

"github.com/spf13/cast"

"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/pkg/firewall"
"github.com/TheTNB/panel/pkg/os"
"github.com/TheTNB/panel/pkg/shell"
"github.com/TheTNB/panel/pkg/systemctl"
)
Expand Down
3 changes: 2 additions & 1 deletion internal/data/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"context"
"errors"
"fmt"
"path/filepath"

"github.com/go-rat/utils/hash"
"github.com/knadh/koanf/v2"
"github.com/spf13/cast"
"gopkg.in/yaml.v3"
"gorm.io/gorm"
"path/filepath"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
Expand Down
1 change: 1 addition & 0 deletions internal/data/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package data

import (
"fmt"

"gorm.io/gorm"

"github.com/TheTNB/panel/internal/biz"
Expand Down
5 changes: 3 additions & 2 deletions internal/data/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package data

import (
"fmt"
"github.com/TheTNB/panel/pkg/queue"
"gorm.io/gorm"
"log/slog"

"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
"github.com/TheTNB/panel/internal/queuejob"
"github.com/TheTNB/panel/pkg/queue"
)

type taskRepo struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/data/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"encoding/json"
"errors"
"fmt"
"gorm.io/gorm"
"path/filepath"
"slices"
"strings"
"time"

"github.com/samber/lo"
"github.com/spf13/cast"
"gorm.io/gorm"

"github.com/TheTNB/panel/internal/app"
"github.com/TheTNB/panel/internal/biz"
Expand Down
4 changes: 2 additions & 2 deletions internal/http/middleware/entrance.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package middleware

import (
"github.com/go-rat/sessions"
"github.com/knadh/koanf/v2"
"net/http"
"strings"

"github.com/go-rat/chix"
"github.com/go-rat/sessions"
"github.com/knadh/koanf/v2"
"github.com/spf13/cast"
)

Expand Down
Loading

0 comments on commit 1fdc86c

Please sign in to comment.