Skip to content

Instantly share code, notes, and snippets.

View j2gg0s's full-sized avatar

j2gg0s j2gg0s

  • Shanghai
  • 20:17 (UTC +08:00)
View GitHub Profile
@j2gg0s
j2gg0s / gitlabci
Created May 6, 2022 17:24
GitLabci include different local file for different environments.
1. Add to .gitlab-ci.yaml
```yml
includes:
- project: "$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME"
ref: "$CI_COMMIT_SHA"
file: "$LOCAL_CONFIG_FILE"
rules:
- if: '$LOCAL_CONFIG_FILE != ""'
```
@j2gg0s
j2gg0s / go_timezone.go
Created September 6, 2021 13:59
magic with go's time with default location
package main
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/require"
)
@j2gg0s
j2gg0s / bson_test.go
Created May 26, 2021 14:19
Surprise with MongoDB Extended JSON
package main
import (
"testing"
"github.com/stretchr/testify/require"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"sync"
)
type User struct {