Skip to content

Instantly share code, notes, and snippets.

View jcdan3's full-sized avatar
💭
I may be slow to respond.

JC Dansereau jcdan3

💭
I may be slow to respond.
  • Shopify
  • Quebec, QC
  • 02:35 (UTC -04:00)
View GitHub Profile
@jcdan3
jcdan3 / gist:9ed9b8523b990b48f5829e3fbbe0d7a0
Created January 15, 2022 18:01
convert json to struct
test
git clone https://github.com/GamestonkTerminal/GamestonkTerminal
cd GamestonkTerminal
safety check -r requirements.txt
@jcdan3
jcdan3 / flask
Last active January 7, 2022 19:10
git clone https://github.com/pallets/flask.git
cd flask
safety check -r requirements/dev.txt
@jcdan3
jcdan3 / gosec
Last active January 8, 2022 05:56
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 ./...
cd compose
go list -json -deps ./... | nancy sleuth > nancy_scan_results.txt
@jcdan3
jcdan3 / building_nancy.sh
Last active December 18, 2021 00:56
Running nancy
git clone https://github.com/sonatype-nexus-community/nancy.git
cd nancy
go get ./...
go build -o nancy .
package mockingdemo
import (
"golangtips/mockingdemo/mocks"
"testing"
)
func TestFileSystem_PrintFileContent(t *testing.T) {
type fields struct {
conn FileConnector
// 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
}
package mockingdemo
import "fmt"
type FileSystem struct{
conn FileConnector
}
func NewFS() FileSystem{
fs := FileSystem{conn: NewFileConnector()}
package mockingdemo
import "os"
type FileConnector interface{
ReadFromFile(name string) ([]byte, error)
}
type fileConnector struct{}