-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new test case * Fix wrong test description * Implement strict mode * Add strict flag * Add testcase * Add test case for strict mode * Prepare config instances for each test case * Add README about strict mode * Apply suggestions from code review Co-authored-by: Julian Friedman <julz.friedman@uk.ibm.com> * Fix for review * Rename -strict flag to -no-unaliased Co-authored-by: Julian Friedman <julz.friedman@uk.ibm.com>
- Loading branch information
Showing
10 changed files
with
112 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package a | ||
|
||
import ( | ||
fff "fmt" // want `import "fmt" imported as "wrong_alias" but must be "fff" according to config` | ||
fff "fmt" // want `import "fmt" imported as "wrong_alias" but must be "fff" according to config` | ||
"io" | ||
stdos "os" // want `import "os" imported as "wrong_alias_again" but must be "stdos" according to config` | ||
) | ||
|
||
func ImportAsWrongAlias() { | ||
fff.Println("foo") | ||
stdos.Stdout.WriteString("bar") | ||
io.Pipe() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package e | ||
|
||
import ( | ||
wrong_alias "fmt" // want `import "fmt" imported as "wrong_alias" but must be "fff" according to config` | ||
"io" // want `import "io" imported without alias but must be with alias "iio" according to config` | ||
wrong_alias_again "os" // want `import "os" imported as "wrong_alias_again" but must be "stdos" according to config` | ||
) | ||
|
||
func ImportAsWrongAlias() { | ||
wrong_alias.Println("foo") | ||
wrong_alias_again.Stdout.WriteString("bar") | ||
io.Pipe() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package e | ||
|
||
import ( | ||
fff "fmt" // want `import "fmt" imported as "wrong_alias" but must be "fff" according to config` | ||
iio "io" // want `import "io" imported without alias but must be with alias "iio" according to config` | ||
stdos "os" // want `import "os" imported as "wrong_alias_again" but must be "stdos" according to config` | ||
) | ||
|
||
func ImportAsWrongAlias() { | ||
fff.Println("foo") | ||
stdos.Stdout.WriteString("bar") | ||
iio.Pipe() | ||
} |