fix golangci-lint errors

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2023-05-22 23:03:59 +02:00
parent 1fef5e094f
commit a206ac3eec
11 changed files with 30 additions and 25 deletions

View File

@@ -62,7 +62,6 @@ func buildBinary(packagePath string) (string, []string, error) {
}
runArgs := []string{}
cmdArgs := []string{}
profileArgs := profileArgs()
buildArgs := []string{
"-buildvcs=false", // avoid build cache invalidation
@@ -94,6 +93,7 @@ func buildBinary(packagePath string) (string, []string, error) {
logger := zap.L().Named("builder")
var cmdArgs []string
var test bool
// Build a test binary if profiling is requested
@@ -126,7 +126,7 @@ func buildBinary(packagePath string) (string, []string, error) {
zap.Bool("test", test))
if output, err := exec.Command("go", cmdArgs...).CombinedOutput(); err != nil {
return "", nil, fmt.Errorf("Failed to build %s:\n\nError:\n%s\n\nOutput:\n%s", packagePath, path, string(output))
return "", nil, fmt.Errorf("ailed to build %s:\n\nError:\n%s\n\nOutput:\n%s", packagePath, path, string(output))
}
logger.Debug("Finished building",

View File

@@ -1,7 +1,7 @@
package nodes
import (
"github.com/pion/ice/v2"
"github.com/pion/stun"
g "github.com/stv0g/gont/v2/pkg"
)
@@ -9,7 +9,7 @@ type RelayNode interface {
Node
WaitReady() error
URLs() []*ice.URL
URLs() []*stun.URI
Username() string
Password() string

View File

@@ -9,7 +9,6 @@ import (
"strconv"
"time"
"github.com/pion/ice/v2"
"github.com/pion/stun"
g "github.com/stv0g/gont/v2/pkg"
copt "github.com/stv0g/gont/v2/pkg/options/cmd"
@@ -145,27 +144,27 @@ func (c *CoturnNode) WaitReady() error {
return nil
}
func (c *CoturnNode) URLs() []*ice.URL {
func (c *CoturnNode) URLs() []*stun.URI {
host := c.Name()
return []*ice.URL{
return []*stun.URI{
{
Scheme: ice.SchemeTypeSTUN,
Scheme: stun.SchemeTypeSTUN,
Host: host,
Port: stun.DefaultPort,
Proto: ice.ProtoTypeUDP,
Proto: stun.ProtoTypeUDP,
},
{
Scheme: ice.SchemeTypeTURN,
Scheme: stun.SchemeTypeTURN,
Host: host,
Port: stun.DefaultPort,
Proto: ice.ProtoTypeUDP,
Proto: stun.ProtoTypeUDP,
},
{
Scheme: ice.SchemeTypeTURN,
Scheme: stun.SchemeTypeTURN,
Host: host,
Port: stun.DefaultPort,
Proto: ice.ProtoTypeTCP,
Proto: stun.ProtoTypeTCP,
},
}
}

View File

@@ -9,7 +9,7 @@ import (
type RelayList []RelayNode
func AddRelayNodes(n *g.Network, numNodes int, opts ...g.Option) (RelayList, error) {
func AddRelayNodes(n *g.Network, numNodes int, _ ...g.Option) (RelayList, error) {
ns := RelayList{}
for i := 1; i <= numNodes; i++ {

View File

@@ -9,7 +9,7 @@ import (
type SignalingList []SignalingNode
func AddSignalingNodes(n *g.Network, numNodes int, opts ...g.Option) (SignalingList, error) {
func AddSignalingNodes(n *g.Network, numNodes int, _ ...g.Option) (SignalingList, error) {
ns := SignalingList{}
for i := 1; i <= numNodes; i++ {

View File

@@ -147,7 +147,7 @@ var _ = Context("simple: Simple local-area switched topology with variable numbe
Context("host: Allow only host candidates", func() {
Context("ipv4: Allow IPv4 network only", func() {
ConnectivityTestsWithExtraArgs("--ice-candidate-type", "host", "--ice-network-type", "udp4") //, "--port-forwarding=false")
ConnectivityTestsWithExtraArgs("--ice-candidate-type", "host", "--ice-network-type", "udp4") // , "--port-forwarding=false")
})
Context("ipv6: Allow IPv6 network only", func() {