Skip to content

Commit

Permalink
ci: set up CI for Go (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh authored Oct 4, 2023
1 parent bc82d16 commit bcb8df7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ jobs:
- run: cargo fmt -- --check
- run: cargo clippy
- run: cargo test
go-check:
uses: pl-strflt/uci/.github/workflows/go-check.yml@v0.0
with:
go-version: '1.21.x'
go-test:
uses: pl-strflt/uci/.github/workflows/go-test.yml@v0.0
with:
go-versions: '["1.21.x"]'
8 changes: 4 additions & 4 deletions go-peer/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import "strings"
type stringSlice []string

func (s *stringSlice) String() string {
return strings.Join(*s, ", ")
return strings.Join(*s, ", ")
}

func (s *stringSlice) Set(value string) error {
*s = append(*s, value)
return nil
}
*s = append(*s, value)
return nil
}
3 changes: 2 additions & 1 deletion go-peer/identity.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package main

// Borrowed from https://github.com/libp2p/go-libp2p-relay-daemon/blob/master/identity.go

import (
Expand Down Expand Up @@ -46,4 +47,4 @@ func GenerateIdentity(path string) (crypto.PrivKey, error) {
err = os.WriteFile(path, bytes, 0400)

return privk, err
}
}
6 changes: 3 additions & 3 deletions go-peer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/tls"
"flag"
"fmt"
"io/ioutil"
"io"
"log"
"os"
"sync"
Expand Down Expand Up @@ -136,13 +136,13 @@ func main() {
f, err := os.OpenFile("log.txt", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Println("failed to open log file", err)
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
} else {
defer f.Close()
log.SetOutput(f)
}
} else {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}

ctx := context.Background()
Expand Down

1 comment on commit bcb8df7

@vercel
Copy link

@vercel vercel bot commented on bcb8df7 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.