enable govet and unparam linters

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2023-04-11 12:07:04 +02:00
committed by GitHub
parent 4a6147a155
commit 10ddd9e454
11 changed files with 61 additions and 66 deletions

View File

@@ -83,8 +83,7 @@ var _ = Describe("portmap integration tests", func() {
fmt.Fprintln(GinkgoWriter, "namespace:", targetNS.Path())
// Start an echo server and get the port
containerPort, session, err = StartEchoServerInNamespace(targetNS)
Expect(err).NotTo(HaveOccurred())
containerPort, session = StartEchoServerInNamespace(targetNS)
})
AfterEach(func() {
@@ -329,8 +328,7 @@ var _ = Describe("portmap integration tests", func() {
fmt.Fprintln(GinkgoWriter, "namespace:", targetNS2.Path())
// Start an echo server and get the port
containerPort, session2, err := StartEchoServerInNamespace(targetNS2)
Expect(err).NotTo(HaveOccurred())
containerPort, session2 := StartEchoServerInNamespace(targetNS2)
runtimeConfig2 := libcni.RuntimeConf{
ContainerID: fmt.Sprintf("unit-test2-%d", hostPort),

View File

@@ -65,7 +65,7 @@ func startInNetNS(binPath string, netNS ns.NetNS) (*gexec.Session, error) {
return session, err
}
func StartEchoServerInNamespace(netNS ns.NetNS) (int, *gexec.Session, error) {
func StartEchoServerInNamespace(netNS ns.NetNS) (int, *gexec.Session) {
session, err := startInNetNS(echoServerBinaryPath, netNS)
Expect(err).NotTo(HaveOccurred())
@@ -76,5 +76,5 @@ func StartEchoServerInNamespace(netNS ns.NetNS) (int, *gexec.Session, error) {
port, err := strconv.Atoi(portString)
Expect(err).NotTo(HaveOccurred())
return port, session, nil
return port, session
}