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 table | |
import ( | |
"fmt" | |
"io/ioutil" | |
"math/rand" | |
"os" | |
"testing" | |
"time" |
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
type foo interface { | |
increment() | |
} | |
type X struct { | |
i int | |
} | |
func (x *X) increment() { | |
x.i++ |
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" | |
"log" | |
"github.com/dgraph-io/badger" | |
) | |
func main() { |
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
PROJECT_NAME=devopsconsole-operator | |
PACKAGE_NAME:=github.com/redhat-developer/$(PROJECT_NAME) | |
CUR_DIR=$(shell pwd) | |
TMP_PATH=$(CUR_DIR)/tmp | |
INSTALL_PREFIX=$(CUR_DIR)/bin | |
VENDOR_DIR=vendor | |
INCLUDE_DIR=make | |
SOURCE_DIR ?= . | |
SOURCES := $(shell find $(SOURCE_DIR) -path $(SOURCE_DIR)/vendor -prune -o -name '*.go' -print) |
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
OPENSHIFT_JENKINS_JVM_ARCH is set to i686 so using 32 bit Java | |
Feb 01, 2019 11:27:42 AM INFO: Using temp directory /var/lib/jenkins/tmp.3QqiSqnR0i for generating configurations | |
Feb 01, 2019 11:27:53 AM INFO: Generating kubernetes-plugin configuration (/opt/openshift/configuration/config.xml.tpl) | |
Feb 01, 2019 11:27:53 AM INFO: Generating kubernetes-plugin credentials (credentials.xml) ... | |
Feb 01, 2019 11:27:53 AM INFO: Copying Jenkins configuration to /var/lib/jenkins | |
Feb 01, 2019 11:27:53 AM INFO: Removing template files (*.tpl) from /var/lib/jenkins | |
Feb 01, 2019 11:27:53 AM INFO: Removed temp directory /var/lib/jenkins/tmp.3QqiSqnR0i | |
Removing existing /var/lib/jenkins/plugins from gluster storage | |
Symlinking /var/lib/jenkins/plugins to /opt/openshift/plugins |
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
// DeleteCreatedEntities sets up GORM `onCreate` hook and return a function that can be deferred to | |
// remove all the entities created after the hook was set up | |
// You can use it as | |
// | |
// func TestSomething(t *testing.T){ | |
// db, _ := gorm.Open(...) | |
// | |
// cleaner := DeleteCreatedEntities(db) | |
// defer cleaner() | |
// |
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" | |
"testing" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/sqlite" | |
) |
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" | |
"testing" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/sqlite" | |
) |
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 ( | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/sqlite" | |
) | |
type Product struct { | |
gorm.Model | |
Code string |
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
➜ ~ oc new-app -f https://raw.githubusercontent.com/golang-starters/golang-health-check/master/.openshiftio/application.yaml \ | |
-p SOURCE_REPOSITORY_URL=https://github.com/golang-starters/golang-health-check | |
--> Deploying template "ijarif-preview-stage/launchpad-builder" for "https://raw.githubusercontent.com/golang-starters/golang-health-check/master/.openshiftio/application.yaml" to project ijarif-preview-stage | |
launchpad-builder | |
--------- | |
This template creates a Build Configuration using an S2I builder. | |
* With parameters: | |
* Suffix name= |
NewerOlder