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
version: '3' | |
services: | |
tests_app: | |
build: . | |
volumes: | |
- ./:/go/src/my_app | |
working_dir: /go/src/my_app/tests | |
entrypoint: go test | |
debug_tests_app: | |
build: . |
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
version: '3' | |
services: | |
app: | |
build: . | |
restart: on-failure | |
volumes: | |
- .:/go/src/my_app | |
entrypoint: dlv debug --headless --listen=:2345 --api-version=2 | |
ports: | |
- "your_app_outside_container_port:your_app_inside_container_port" |
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
up_local: | |
docker-compose up | |
restart_local: | |
docker-compose restart app | |
clear_tests: | |
docker-compose -f docker-compose.tests.yml rm -v -f | |
tests: | |
docker-compose -f docker-compose.tests.yml rm -v -f | |
docker-compose -f docker-compose.tests.yml up --exit-code-from tests_app | |
docker-compose -f docker-compose.tests.yml rm -v -f |
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" | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/gomodule/redigo/redis" | |
) |
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 ( | |
monitoring "cloud.google.com/go/monitoring/apiv3/v2" | |
"context" | |
"google.golang.org/api/iterator" | |
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" | |
"log" | |
) |
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" | |
"github.com/99designs/gqlgen/api" | |
"github.com/99designs/gqlgen/codegen/config" | |
"github.com/99designs/gqlgen/plugin/modelgen" | |
"os" | |
"regexp" | |
"strings" |
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
seed(). | |
upgrade(). | |
createWebsites(createWebsitesP{blocked: true}). | |
goFreemium(). | |
freemiumTask(freemiumTaskP{mockTime: true}). | |
checkBlockedWebsites(checkBlockedWebsitesP{expect: []}) | |
stateMachine := []interface{ | |
{Name: "upgrade", Src: []string{"trial"}, Dst: "has_plan"}, | |
{Name: "goFreemium", Src: []string{"has_plan"}, Dst: "has_freemium", MiddleState: "upgrade"}, |
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
const url = "api.example.com/images"; | |
fetch("https://blob:example.com") | |
.then((response) => response.body) | |
.then((rb) => { | |
const reader = rb.getReader(); | |
return new ReadableStream({ | |
start(controller) { | |
// The following function handles each data chunk |
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 ( | |
"database/sql" | |
"fmt" | |
_ "github.com/go-sql-driver/mysql" | |
"github.com/google/go-cmp/cmp" | |
"github.com/ory/dockertest/v3" | |
"testing" | |
) |
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
function helloWorld() { | |
console.log("Hello World") | |
} | |
helloWorld() |
OlderNewer