tools/modulecopier/internal/copy.go
Function getUpdatedFileContents
has 8 return statements (exceeds 4 allowed). Open
Open
func getUpdatedFileContents(path, newPackageName string) (fileContents []byte, err error) {
file, err := pkger.Open(path)
if err != nil {
return fileContents, fmt.Errorf("could not open file at %s: %w", path, err)
}
Function CopyModule
has 6 return statements (exceeds 4 allowed). Open
Open
func CopyModule(toCopy, dest, packageName string) error {
// walk through the dir, see: https://github.com/markbates/pkger/blob/09e9684b656b/examples/app/main.go#L29
info, err := pkger.Info(toCopy)
if err != nil {
return fmt.Errorf("could not resolve %s", toCopy)
Function CopyFile
has 6 return statements (exceeds 4 allowed). Open
Open
func CopyFile(fileToCopy, dest, packageName string) error {
// first things first, pkger operates on go modules, so we need to trim
modulePath := path.Dir(fileToCopy)
fileName := path.Base(fileToCopy)
Function copyGoFile
has 5 return statements (exceeds 4 allowed). Open
Open
func copyGoFile(filePath, packageName, dest string, info fs.FileInfo) error {
fileContents, err := getUpdatedFileContents(filePath, packageName)
if err != nil {
return fmt.Errorf("could not get updated file contents: %w", err)
}