- `project.go`
- Rename method {checkCfgFilenames => checkGopkgFilenames}
- Improve funciton comment as suggested by @sdboyer
- Fix ambigious comment explaining rationale behind early return.
- Add comment explaining why we do not use `fs.IsCaseSensitiveFilesystem` for
skipping following tests:
- context_test.go#TestLoadProjectGopkgFilenames
- project_test.go#TestCheckGopkgFilenames
- fs_test.go#TestReadActualFilenames
- `project`
- `checkCfgFilenames`
- Improve function and code comments
- Use boolean value indicating whether value was found in actual filenames.
If manifest file was not found, return `errProjectNotFound`. Use boolean
to determine if lock file was not found instead of length check.
- `TestCheckCfgFilenames` - Add code comments for test cases explaining the
expected behavior
- `fs`
- `ReadActualFilenames`
- Use cleaner check(`<=` ➡ `==`) to see if `names` parameter for
`ReadActualFilenames` actually has any values.
- Use `Readdirnames` instead of `Readdir`. This is expected to perform
better in most cases.
- `TestReadActualFilenames` - Add code comments for test cases explaining the
expected behavior
- general
- Make line length for code comments consistent(90), add periods where
appropriate.
- String formatting, use %q instead of '%s'
- `fs`
- Export `IsCaseSensitiveFilesystem`. Add and run test on windows, linux and
macOS.
- Add function `ReadActualFilenames` to read actual file names of given
string slice. Add tests to be run on windows and macOS.
- `project`
- Add function `checkCfgFilenames` to check the filenames for manifest
and lock have the expected case. Use `fs#IsCaseSensitiveFilesystem`
for an early return as the check is costly. Add test to be run on windows
and macOS.
- `context`
- Call `project.go#checkCfgFilenames` after resolving project root. Add test
for invalid manifest file name to be run on windows and macOS.
- Creates backup of vendor directory, if exists with content, at init.
- Adds tests for BackupVendor() function.
- Adds RemoveFile() function to test helper.
In this commit, the testing framework used in dep is moved to the
test package, since it's used either in dep and main.
All the code that is not part of a command has been moved to the
dep subpackage, as well as all those functions that were shared between
dep and main, since dep cannot depend on main.
Because of the movement to another package, many structs, methods and
functions have become public.