Skip to content

Commit 4438cf5

Browse files
committed
add go modules, some cleanup
1 parent 4b8b9aa commit 4438cf5

File tree

6 files changed

+71
-24
lines changed

6 files changed

+71
-24
lines changed

.github/workflows/pullrequests.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Tests
2+
on: [pull_request]
3+
4+
jobs:
5+
test:
6+
name: Test
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- name: Setup Go
12+
uses: actions/setup-go@v3
13+
with:
14+
go-version: 'stable'
15+
16+
- name: Go Tests
17+
run: go test -v ./...

.github/workflows/release.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: Build and Release
10+
runs-on: [ubuntu-latest]
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Release Version
16+
id: version
17+
run: |
18+
export RELEASE_VERSION=v0.0.${{ github.run_number }}
19+
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
20+
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
21+
22+
- name: create tag
23+
run: |
24+
git config --local user.email "[email protected]"
25+
git config --local user.name "GitHub Action"
26+
git tag -a $RELEASE_VERSION -m $RELEASE_VERSION
27+
git push origin $RELEASE_VERSION
28+

.travis.yml

-15
This file was deleted.

go.mod

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module github.com/jasonhancock/multiplex
2+
3+
go 1.21.3
4+
5+
require github.com/stretchr/testify v1.8.4
6+
7+
require (
8+
github.com/davecgh/go-spew v1.1.1 // indirect
9+
github.com/pmezard/go-difflib v1.0.0 // indirect
10+
gopkg.in/yaml.v3 v3.0.1 // indirect
11+
)

go.sum

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5+
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
6+
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
8+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
9+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
10+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

plexer_test.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/cheekybits/is"
10+
"github.com/stretchr/testify/require"
1111
)
1212

1313
func TestPlexer(t *testing.T) {
14-
is := is.New(t)
15-
1614
var chans []chan []byte
1715
for i := 0; i < 10; i++ {
1816
chans = append(chans, make(chan []byte, 1000))
@@ -50,14 +48,12 @@ func TestPlexer(t *testing.T) {
5048
mod++
5149
}
5250
val, err := strconv.Atoi(string(values[i]))
53-
is.NoErr(err)
54-
is.True(val%10 == mod)
51+
require.NoError(t, err)
52+
require.True(t, val%10 == mod)
5553
}
5654
}
5755

5856
func TestPlexerCloseChan(t *testing.T) {
59-
is := is.New(t)
60-
6157
var chans []chan []byte
6258

6359
for i := 0; i < 10; i++ {
@@ -94,8 +90,8 @@ func TestPlexerCloseChan(t *testing.T) {
9490
}
9591
wg.Wait()
9692

97-
is.Equal(values[0], []byte("foo"))
98-
is.Equal(values[1], []byte("bar"))
93+
require.Equal(t, []byte("foo"), values[0])
94+
require.Equal(t, []byte("bar"), values[1])
9995
}
10096

10197
func chConv(channels ...chan []byte) []<-chan []byte {

0 commit comments

Comments
 (0)