-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleaning up to follow best practices #8
base: main
Are you sure you want to change the base?
Conversation
d1f0b01
to
63742a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 13 changed files in this pull request and generated 1 comment.
Files not reviewed (7)
- go.work.sum: Language not supported
- walk_test.go: Evaluated as low risk
- import_func_test.go: Evaluated as low risk
- embed_func_test.go: Evaluated as low risk
- docs/main.go: Evaluated as low risk
- templit.go: Evaluated as low risk
- funcs.go: Evaluated as low risk
Comments suppressed due to low confidence (3)
cmd/templit/templit.go:1
- Verify if the //nolint comments are necessary. If not, they should be removed.
//nolint:gochecknoglobals,gochecknoinits
dep.go:25
- [nitpick] The error message
invalid path
is too generic. Consider providing more context, such asinvalid path format in embed URL
.
var ErrInvalidPath = errors.New("invalid path")
import_func.go:58
- The error message is redundant. It should be simplified to avoid redundancy.
return "", fmt.Errorf("file does not exist %s, %w", sourcePath, os.ErrNotExist)
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 13 changed files in this pull request and generated no comments.
Files not reviewed (7)
- go.work.sum: Language not supported
- walk_test.go: Evaluated as low risk
- import_func_test.go: Evaluated as low risk
- docs/main.go: Evaluated as low risk
- embed_func_test.go: Evaluated as low risk
- templit.go: Evaluated as low risk
- funcs.go: Evaluated as low risk
Comments suppressed due to low confidence (4)
string_funcs.go:116
- The function
capitalizeFirstLetter
may cause an out-of-bounds error if the input string is a single character. Consider updating the function to handle single-character strings properly.
return strings.ToUpper(string(s[0])) + strings.ToLower(s[1:])
dep.go:39
- The error message 'invalid path' is less descriptive compared to the original 'invalid path format in embed URL'. It should be reverted to the original message for clarity.
expectedError: fmt.Errorf("invalid path"),
import_func.go:57
- The os.IsNotExist(err) check is inside the condition where err == nil, which means it will never be executed. It should be outside the err == nil condition.
if os.IsNotExist(err) {
import_func.go:65
- The variable name 'string' is a reserved keyword in Go and should be renamed to avoid confusion. Consider renaming it to 'output'.
string, err := e.Render(sourcePath, data)
No description provided.