Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Run go fmt ./... and go mod tidy -go=1.17
Browse files Browse the repository at this point in the history
Signed-off-by: Eng Zer Jun <[email protected]>
  • Loading branch information
Juneezee committed Nov 20, 2021
1 parent a20a4a8 commit ef07133
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 74 deletions.
5 changes: 2 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package config

import (
"log"

"encoding/json"
"fmt"
"io/ioutil"
"log"
"strings"
"sync"
"time"

"github.com/aerokube/selenoid/session"
"github.com/docker/docker/api/types/container"
"time"
)

// Session - session id and vnc flag
Expand Down
19 changes: 11 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@ module github.com/aerokube/selenoid
go 1.17

require (
github.com/Microsoft/go-winio v0.4.12 // indirect
github.com/aandryashin/matchers v0.0.0-20161126170413-435295ea180e
github.com/aerokube/ggr v0.0.0-20181215175518-4a2e23fa1769
github.com/aerokube/util v0.0.0-20190701120823-161c21b50f69
github.com/aws/aws-sdk-go v1.20.12
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v0.7.3-0.20190629173937-e105a74c5419
github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.4.0
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/imdario/mergo v0.3.6
github.com/mafredri/cdp v0.21.0
github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c
github.com/pkg/errors v0.8.1
golang.org/x/net v0.0.0-20190311183353-d8887717615a
)

require (
github.com/Microsoft/go-winio v0.4.12 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/mafredri/cdp v0.21.0
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 // indirect
google.golang.org/grpc v1.21.1 // indirect
Expand Down
13 changes: 5 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,31 @@ import (
"context"
"encoding/json"
"flag"
"github.com/aerokube/selenoid/jsonerror"
"github.com/pkg/errors"
"fmt"
"log"
"net"
"net/http"
"os"
"os/signal"
"path"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"

"golang.org/x/net/websocket"

"fmt"

"path/filepath"

ggr "github.com/aerokube/ggr/config"
"github.com/aerokube/selenoid/config"
"github.com/aerokube/selenoid/jsonerror"
"github.com/aerokube/selenoid/protect"
"github.com/aerokube/selenoid/service"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/selenoid/upload"
"github.com/aerokube/util"
"github.com/aerokube/util/docker"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"golang.org/x/net/websocket"
)

var (
Expand Down
6 changes: 4 additions & 2 deletions metadata.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
//go:build metadata
// +build metadata

package main

import (
"encoding/json"
"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/session"
"io/ioutil"
"log"
"path/filepath"
"time"

"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/session"
)

const metadataFileExtension = ".json"
Expand Down
2 changes: 1 addition & 1 deletion protect/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package protect

import (
"errors"
"github.com/aerokube/selenoid/jsonerror"
"log"
"math"
"net/http"
"time"

"github.com/aerokube/selenoid/jsonerror"
"github.com/aerokube/util"
)

Expand Down
10 changes: 6 additions & 4 deletions s3_test.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
//go:build s3
// +build s3

package main

import (
"context"
. "github.com/aandryashin/matchers"
"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/selenoid/upload"
"io/ioutil"
"net"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"

. "github.com/aandryashin/matchers"
"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/selenoid/upload"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions selenoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/jsonerror"
"github.com/aerokube/selenoid/service"
"github.com/imdario/mergo"
"io"
"io/ioutil"
"log"
Expand All @@ -28,10 +24,14 @@ import (
"sync"
"time"

"github.com/aerokube/selenoid/event"
"github.com/aerokube/selenoid/jsonerror"
"github.com/aerokube/selenoid/service"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/util"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/stdcopy"
"github.com/imdario/mergo"
"golang.org/x/net/websocket"
)

Expand Down
12 changes: 5 additions & 7 deletions selenoid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,24 @@ package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/mafredri/cdp"
"github.com/mafredri/cdp/rpcc"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
"time"

"github.com/aerokube/selenoid/config"

"encoding/json"
"path/filepath"

. "github.com/aandryashin/matchers"
. "github.com/aandryashin/matchers/httpresp"
ggr "github.com/aerokube/ggr/config"
"github.com/aerokube/selenoid/config"
"github.com/mafredri/cdp"
"github.com/mafredri/cdp/rpcc"
)

var _ = func() bool {
Expand Down
8 changes: 4 additions & 4 deletions service/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package service
import (
"context"
"fmt"
"github.com/docker/go-units"
"log"
"net"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"time"

"github.com/aerokube/selenoid/config"
Expand All @@ -20,9 +22,7 @@ import (
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/go-connections/nat"
"os"
"path/filepath"
"strings"
"github.com/docker/go-units"
)

const (
Expand Down
16 changes: 8 additions & 8 deletions service/driver.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package service

import (
"errors"
"fmt"
"log"
"net"
"net/url"
"os"
"os/exec"
"path/filepath"
"time"

"errors"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/util"
"os"
"path/filepath"
)

// Driver - driver processes manager
Expand Down Expand Up @@ -77,11 +77,11 @@ func (d *Driver) StartWithCancel() (*StartedService, error) {
}
log.Printf("[%d] [PROCESS_STARTED] [%d] [%.2fs]", requestId, cmd.Process.Pid, util.SecondsSince(s))
log.Printf("[%d] [PROXY_TO] [%s]", requestId, u.String())
hp := session.HostPort{}
if d.Caps.VNC {
hp.VNC = "127.0.0.1:5900"
}
return &StartedService{Url: u, HostPort: hp, Cancel: func() { d.stopProcess(cmd) }}, nil
hp := session.HostPort{}
if d.Caps.VNC {
hp.VNC = "127.0.0.1:5900"
}
return &StartedService{Url: u, HostPort: hp, Cancel: func() { d.stopProcess(cmd) }}, nil
}

func (d *Driver) stopProcess(cmd *exec.Cmd) {
Expand Down
7 changes: 4 additions & 3 deletions service/driver_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

package service
Expand All @@ -8,7 +9,7 @@ import (
)

func stopProc(cmd *exec.Cmd) error {
exitCode := cmd.Process.Signal(syscall.SIGINT)
cmd.Wait()
return exitCode
exitCode := cmd.Process.Signal(syscall.SIGINT)
cmd.Wait()
return exitCode
}
1 change: 1 addition & 0 deletions service/driver_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package service
Expand Down
17 changes: 9 additions & 8 deletions service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ package main
import (
"bytes"
"fmt"
. "github.com/aandryashin/matchers"
"github.com/aerokube/selenoid/config"
"github.com/aerokube/selenoid/service"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/util"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"golang.org/x/net/websocket"
"io"
"io/ioutil"
"net"
Expand All @@ -21,6 +13,15 @@ import (
"sync"
"testing"
"time"

. "github.com/aandryashin/matchers"
"github.com/aerokube/selenoid/config"
"github.com/aerokube/selenoid/service"
"github.com/aerokube/selenoid/session"
"github.com/aerokube/util"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"golang.org/x/net/websocket"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package session

import (
"github.com/imdario/mergo"
"net/url"
"sync"
"time"

"github.com/imdario/mergo"
)

// Caps - user capabilities
Expand Down
14 changes: 8 additions & 6 deletions upload/s3.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
//go:build s3
// +build s3

package upload

import (
"flag"
"fmt"
"github.com/aerokube/selenoid/event"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
awssession "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/pkg/errors"
"log"
"mime"
"os"
"path/filepath"
"strings"
"time"

"github.com/aerokube/selenoid/event"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
awssession "github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/pkg/errors"
)

func init() {
Expand Down
5 changes: 3 additions & 2 deletions upload/uploader.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package upload

import (
"github.com/aerokube/selenoid/event"
"github.com/aerokube/util"
"log"
"time"

"github.com/aerokube/selenoid/event"
"github.com/aerokube/util"
)

var (
Expand Down
Loading

0 comments on commit ef07133

Please sign in to comment.