Skip to content

Instantly share code, notes, and snippets.

@cep21
cep21 / integration_test.go
Created January 26, 2018 19:40
Example integration test
package trace_110
import (
"testing"
"sync"
"fmt"
"time"
"net/http"
)
@cep21
cep21 / main_test.go
Last active June 24, 2022 02:41
Example test
package main
import (
"sync"
"testing"
)
func TestAppend(t *testing.T) {
x := []string{"start"}
@cep21
cep21 / main_test.go
Created June 11, 2018 18:22
A -race failing test
package main
import (
"testing"
"sync"
)
func TestAppend(t *testing.T) {
x := make([]string, 0, 6)
@cep21
cep21 / main_test.go
Created June 12, 2018 00:23
workaround
package main
import (
"sync"
"testing"
)
func TestAppend(t *testing.T) {
x := make([]string, 0, 6)
x = append(x, "start")
@cep21
cep21 / space.go
Last active May 28, 2019 17:53
Original spaceship
type Ship struct {
Health int
LocX float64
LocY float64
Size float64
}
func (s *Ship) Heal(amnt int) {
if s.Health >= 0 {
s.Health += amnt
@cep21
cep21 / ship.go
Last active May 28, 2019 17:53
Abstracted space ship
type Ship2 struct {
GameKillable
PhysicalObject
}
type PhysicalObject struct {
LocX float64
LocY float64
Size float64
}

Keybase proof

I hereby claim:

  • I am cep21 on github.
  • I am cep21 (https://keybase.io/cep21) on keybase.
  • I have a public key ASAwNIEREtDh3M0e-0fmJBK5AlukNaSfZzfs3spchpbB2Qo

To claim this, I am signing this object: