Short description here.
Badges: https://shields.io/
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| # Usage | |
| sub usage() { | |
| my $usage = <<"EOS"; | |
| $0 creates go mock file in the same directory where the go file is located. | 
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| func main() { | |
| ch1 := make(chan int) | |
| ch2 := make(chan int) | 
| # Returning value | |
| # github.com/aws/aws-sdk-go/service/translate/api.go | |
| # line. 4560 | |
| func newErrorUnsupportedLanguagePairException(v protocol.ResponseMetadata) error { | |
| return &UnsupportedLanguagePairException{ | |
| RespMetadata: v, | |
| } | |
| } | |
| # Redundancy | 
| // Package collection provides collection data structure. | |
| package collection | |
| const ( | |
| // Use as the stuffing data. | |
| // Use "map" for implementing this struct but it does not use the value of map, | |
| // so set dummy value to the map value. | |
| _stuffing = 0 | |
| ) | 
| #!/usr/bin/env bash | |
| # golang-migrate helper script | |
| # https://github.com/golang-migrate/migrate | |
| usage() { | |
| echo "Usage: migrate.sh COMMAND | |
| COMMAND: | |
| Input golang-migrate command and options. | 
| # Create virtual env in {directory} | |
| pyton3 -v venv {directory} | |
| # - Activate | |
| source {directory}/bin/activate | |
| # - Deactivate | |
| deactivate | 
Short description here.
Badges: https://shields.io/
| # Stop all containers | |
| docker stop $(docker ps -q) | |
| # Remove all containers | |
| docker rm $(docker ps -q -a) | |
| # Remove all images | |
| $ docker rmi $(docker images -q) | |
| #!/usr/bin/env bash | |
| # Ref: https://qiita.com/koara-local/items/2d67c0964188bba39e29 | |
| # Ref: https://qiita.com/mashumashu/items/f5b5ff62fef8af0859c5 | |
| SCRIPT_DIR=$(cd $(dirname $0); pwd) | |
| function usage() { | |
| cat <<_EOT_ | |
| Usage: | 
| // Testing if testFunc calls panic. | |
| // e.g. | |
| // IsTestCallPanic(func(){ | |
| // <place test target here.> | |
| // }) | |
| func IsTestCallPanic(testFunc func()) (ok bool){ | |
| defer func() { | |
| if err := recover(); err == nil { | |
| ok = false | |
| } |