rename: module
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/nullSafetyCheck"
|
||||||
|
"github.com/kuzgoga/gormlint/relationsCheck"
|
||||||
"golang.org/x/tools/go/analysis/multichecker"
|
"golang.org/x/tools/go/analysis/multichecker"
|
||||||
"gormlint/nullSafetyCheck"
|
|
||||||
"gormlint/relationsCheck"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
|||||||
module gormlint
|
module github.com/kuzgoga/gormlint
|
||||||
|
|
||||||
go 1.23.2
|
go 1.23.2
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package nullSafetyCheck
|
package nullSafetyCheck
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/common"
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
"gormlint/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package relationsCheck
|
package relationsCheck
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"gormlint/common"
|
"github.com/kuzgoga/gormlint/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func IsBelongsTo(field common.Field, model common.Model, relatedModel common.Model) bool {
|
func IsBelongsTo(field common.Field, model common.Model, relatedModel common.Model) bool {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package relationsCheck
|
package relationsCheck
|
||||||
|
|
||||||
import "gormlint/common"
|
import "github.com/kuzgoga/gormlint/common"
|
||||||
|
|
||||||
func IsHasOne(field common.Field, model common.Model, relatedModel common.Model) bool {
|
func IsHasOne(field common.Field, model common.Model, relatedModel common.Model) bool {
|
||||||
foreignKey := field.Tags.GetParamOr("foreignKey", model.Name+"Id")
|
foreignKey := field.Tags.GetParamOr("foreignKey", model.Name+"Id")
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package relationsCheck
|
package relationsCheck
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/common"
|
||||||
"go/token"
|
"go/token"
|
||||||
"go/types"
|
"go/types"
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
"gormlint/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package relationsCheck
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/kuzgoga/gormlint/common"
|
||||||
"go/types"
|
"go/types"
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
"gormlint/common"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func findBackReferenceInOneToMany(model common.Model, relatedModel common.Model) *common.Field {
|
func findBackReferenceInOneToMany(model common.Model, relatedModel common.Model) *common.Field {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package relationsCheck
|
package relationsCheck
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/common"
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
"gormlint/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package relationsCheck
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/kuzgoga/gormlint/common"
|
||||||
"golang.org/x/tools/go/analysis"
|
"golang.org/x/tools/go/analysis"
|
||||||
"gormlint/common"
|
|
||||||
"slices"
|
"slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/nullSafetyCheck"
|
||||||
"golang.org/x/tools/go/analysis/analysistest"
|
"golang.org/x/tools/go/analysis/analysistest"
|
||||||
"gormlint/nullSafetyCheck"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/kuzgoga/gormlint/relationsCheck"
|
||||||
"golang.org/x/tools/go/analysis/analysistest"
|
"golang.org/x/tools/go/analysis/analysistest"
|
||||||
"gormlint/relationsCheck"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user