-
Notifications
You must be signed in to change notification settings - Fork 12
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
added test for site set #70
base: develop
Are you sure you want to change the base?
Conversation
@@ -15,6 +15,7 @@ require ( | |||
github.com/rs/cors v1.7.0 | |||
github.com/shirou/gopsutil v3.21.4+incompatible | |||
github.com/spf13/cobra v1.1.3 | |||
github.com/stretchr/testify v1.3.0 |
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.
1.3.0 is kinda old, the latest version is 1.7.0
} | ||
|
||
func removeFile(baseFileName string) { | ||
err := os.RemoveAll(baseFileName) |
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.
Your indentation is inconsistent, you might want to run gofmt
@@ -0,0 +1,164 @@ | |||
package site | |||
|
|||
import ( |
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.
would be nice to run goimports and let it order the imports by
- Standard packages
- External packages
- Private packages
assert.Equal(t, tt.want, output) | ||
|
||
removeFile(baseFileName) | ||
|
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.
spurious newline
} | ||
|
||
func TestSetSite(t *testing.T) { | ||
|
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.
spurious newline
fileName := filepath.Join(baseFileName, tt.args["pathToSiteInfo"].(string)) | ||
|
||
dest, err := os.Create(fileName) | ||
|
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.
it would be better style to stick the line where err is instantiated with the line where the error is checked
Hi @Sampriti-Mitra |
Checklist
Please note that in case of below checklist not updated accordingly, the maintainers have the right to immediately close your pull request.
develop
branch.develop
branch and not onmain
.Description of the Change
Alternate Designs
Risk Impact
Verification Process
Release Notes