Skip to content

Commit e885a15

Browse files
committed
1. Renamed testdata package
2. Renamed linter
1 parent 2cebf9f commit e885a15

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ func nextID() int64 {
122122

123123
## TODO
124124

125+
### Features that are difficult to implement and unplanned
126+
125127
1. Type assertion, type declaration and type underlying, [tests](testdata/src/factory/default/type_nested.go.skip).

factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const (
4747

4848
func NewAnalyzer() *analysis.Analyzer {
4949
analyzer := &analysis.Analyzer{
50-
Name: "factory",
50+
Name: "gofactory",
5151
Doc: "Blocks the creation of structures directly, without a factory.",
5252
Requires: []*analysis.Analyzer{inspect.Analyzer},
5353
}

lint_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestLinterSuite(t *testing.T) {
2020
pkgs []string
2121
prepare func(t *testing.T, a *analysis.Analyzer)
2222
}{
23-
"default": {pkgs: []string{"default/..."}},
23+
"simple": {pkgs: []string{"simple/..."}},
2424
"blockedPkgs": {
2525
pkgs: []string{"blockedPkgs/..."},
2626
prepare: func(t *testing.T, a *analysis.Analyzer) {

testdata/src/factory/blockedPkgs/blocked/blocked.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package blocked
22

33
import (
44
"factory/blockedPkgs/blocked/blocked_nested"
5-
"factory/default/nested"
5+
"factory/simple/nested"
66
)
77

88
type Struct struct{}

testdata/src/factory/onlyBlockedPkgs/blocked/blocked.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package blocked
22

33
import (
4-
"factory/default/nested"
54
"factory/onlyBlockedPkgs/blocked/blocked_nested"
65
)
76

@@ -22,7 +21,4 @@ func NewPtr() *Struct {
2221
func CallNested2() {
2322
_ = blocked_nested.Struct{}
2423
_ = &blocked_nested.Struct{}
25-
26-
_ = nested.Struct{}
27-
_ = &nested.Struct{}
2824
}

testdata/src/factory/default/main.go renamed to testdata/src/factory/simple/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package blockedPkgs
1+
package simple
22

3-
import "factory/default/nested"
3+
import "factory/simple/nested"
44

55
type Struct struct {
66
}

testdata/src/factory/default/type_nested.go.skip renamed to testdata/src/factory/simple/type_nested.go.skip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package blockedPkgs
1+
package simple
22

3-
import "factory/default/nested"
3+
import "factory/simple/nested"
44

5-
// ident.Obj.Decl.Type could be used to get underlying
5+
// ident.Obj.Decl.Type or use dst could be used to get underlying
66
type DeclStruct nested.Struct
77
type AliasStruct = nested.Struct
88
type UnderlyingStruct struct {

0 commit comments

Comments
 (0)