https://github.com/vikyd/importnotmatchmod-usage
Test if package path last element not match package name
https://github.com/vikyd/importnotmatchmod-usage
Last synced: 11 months ago
JSON representation
Test if package path last element not match package name
- Host: GitHub
- URL: https://github.com/vikyd/importnotmatchmod-usage
- Owner: vikyd
- Created: 2020-07-01T03:03:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-01T03:06:42.000Z (almost 6 years ago)
- Last Synced: 2023-03-04T17:02:40.735Z (about 3 years ago)
- Language: Go
- Size: 0 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pkgnotmatch-use
Test if package path last element not match package name
# Usage
Download or git clone this respo directly.
Run:
```sh
go run main.go
```
# Conclusion
Golang can use package which its name is not match its path.
The customer should use the package name instead of last element of its path.
- success: `abc.F01()`
- failed: `importnotmatchmod.F01()`
About import:
- can be: `import "github.com/vikyd/importnotmatchmod"`
- used as: `abc.F01()`
- can also be: `import abc "github.com/vikyd/importnotmatchmod"`
- used as: `abc.F01()`
- can also be: `import othername "github.com/vikyd/importnotmatchmod"`
- used as: `othername.F01()`