This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mockingdemo | |
| import "os" | |
| type FileConnector interface{ | |
| ReadFromFile(name string) ([]byte, error) | |
| } | |
| type fileConnector struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mockingdemo | |
| import "fmt" | |
| type FileSystem struct{ | |
| conn FileConnector | |
| } | |
| func NewFS() FileSystem{ | |
| fs := FileSystem{conn: NewFileConnector()} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Code generated by mockery v2.9.4. DO NOT EDIT. | |
| package mocks | |
| import mock "github.com/stretchr/testify/mock" | |
| // FileConnector is an autogenerated mock type for the FileConnector type | |
| type FileConnector struct { | |
| mock.Mock | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mockingdemo | |
| import ( | |
| "golangtips/mockingdemo/mocks" | |
| "testing" | |
| ) | |
| func TestFileSystem_PrintFileContent(t *testing.T) { | |
| type fields struct { | |
| conn FileConnector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/sonatype-nexus-community/nancy.git | |
| cd nancy | |
| go get ./... | |
| go build -o nancy . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd compose | |
| go list -json -deps ./... | nancy sleuth > nancy_scan_results.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| go install github.com/securego/gosec/v2/cmd/gosec@latest | |
| git clone https://github.com/kubernetes/kubernetes.git | |
| cd kubernetes | |
| gosec -fmt=text -out=results.txt ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/pallets/flask.git | |
| cd flask | |
| safety check -r requirements/dev.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone https://github.com/GamestonkTerminal/GamestonkTerminal | |
| cd GamestonkTerminal | |
| safety check -r requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |