This file contains 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
// successLoginTest contains context for the test case. The value of each field is | |
// initialize on setup test case setp and will be the reference for clean up the data on clean(). | |
type successLoginTest struct { | |
id int64 | |
email string | |
pass string | |
} | |
// createVerifiedUser creates a user to be tested for login API. | |
func (s *successLoginTest) createVerifiedUser(e *exampleTestSuite) { |
This file contains 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
// +build it | |
package it | |
import ( | |
"database/sql" | |
"io/ioutil" | |
"net/http" | |
"github.com/nydan/integration_test/config" |
This file contains 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 config | |
type Config struct { | |
ConnPsql string | |
} | |
// Load loads a configuration files into Config struct | |
func Load(path string) (Config, error) { | |
return Config{}, nil | |
} |
This file contains 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 main | |
import ( | |
"errors" | |
"fmt" | |
) | |
var ErrInput = errors.New("wrong input") | |
var ErrConfig = errors.New("invalid config") |
This file contains 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
{ | |
"window.menuBarVisibility": "toggle", | |
"go.formatTool": "goimports", | |
"go.useLanguageServer": true, | |
"window.zoomLevel": 0, | |
"keyboard.dispatch": "keyCode", | |
"[go]": { | |
"editor.formatOnSave": true, | |
"editor.codeActionsOnSave": { | |
"source.organizeImports": true, |
This file contains 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 main | |
// Dog struct | |
type Dog struct{} | |
// Speak is receiver method for how the dog speak | |
func (d *Dog) Speak() string { | |
return "woof" | |
} |
This file contains 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
import "database/sql" | |
// Resource is type that being used as an object to receive dependency | |
type Resource struct { | |
db *sql.DB | |
} | |
// New is constructor function that do the injection to Resource | |
func New(db *sql.DB) *Resource { | |
r := &Resource{ |
This file contains 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 main | |
import "fmt" | |
func trace(requestName func() string) func(string) string { | |
return func(text string) string { | |
request := requestName() | |
return fmt.Sprintf("operation: %s, request: %s", request, text) | |
} |
This file contains 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 main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"syscall" |
This file contains 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 list -f '{{.Deps}}' | tr "[" " " | tr "]" " " | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' |
NewerOlder