aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 09:09:01 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 09:20:29 +0200
commit3fef806e674f913b712e834269f20be1e678677b (patch)
tree8a16669f242614a3eb4f980ad499adc9ba73638a
parentservice: reuse golang.org/x/sys/windows address family constants (diff)
downloadwireguard-windows-3fef806e674f913b712e834269f20be1e678677b.tar.xz
wireguard-windows-3fef806e674f913b712e834269f20be1e678677b.zip
global: regroup all imports
-rw-r--r--conf/dnsresolver_windows.go3
-rw-r--r--conf/dpapi/dpapi_windows.go3
-rw-r--r--conf/dpapi/dpapi_windows_test.go3
-rw-r--r--conf/path_windows.go3
-rw-r--r--conf/store.go3
-rw-r--r--conf/storewatcher_windows.go3
-rw-r--r--main.go9
-rw-r--r--ringlogger/dump_windows.go7
-rw-r--r--ringlogger/global.go3
-rw-r--r--ringlogger/ringlogger_windows.go3
-rw-r--r--service/errors.go3
-rw-r--r--service/firewall/helpers.go3
-rw-r--r--service/firewall/rules.go5
-rw-r--r--service/install.go7
-rw-r--r--service/ipc_client.go5
-rw-r--r--service/ipc_pipe.go3
-rw-r--r--service/ipc_server.go11
-rw-r--r--service/names.go1
-rw-r--r--service/securityapi.go3
-rw-r--r--service/service_manager.go9
-rw-r--r--service/service_tunnel.go15
-rw-r--r--service/tunneltracker.go9
-rw-r--r--service/updatestate.go5
-rw-r--r--ui/iconprovider.go5
-rw-r--r--ui/listview.go3
-rw-r--r--ui/tray.go3
-rw-r--r--ui/tunnelspage.go9
-rw-r--r--ui/ui.go7
-rw-r--r--ui/updatepage.go1
-rw-r--r--updater/downloader.go5
-rw-r--r--updater/msirunner_windows.go5
-rw-r--r--updater/signify.go3
-rw-r--r--updater/versions.go3
-rw-r--r--version/debugging_linux.go1
-rw-r--r--version/official_windows.go5
-rw-r--r--version/os_windows.go3
-rw-r--r--version/useragent.go3
-rw-r--r--version/version_windows.go3
-rw-r--r--version/wintrust/certificate_windows.go3
-rw-r--r--version/wintrust/wintrust_windows.go3
40 files changed, 112 insertions, 72 deletions
diff --git a/conf/dnsresolver_windows.go b/conf/dnsresolver_windows.go
index 65ae383..165baf3 100644
--- a/conf/dnsresolver_windows.go
+++ b/conf/dnsresolver_windows.go
@@ -7,12 +7,13 @@ package conf
import (
"fmt"
- "golang.org/x/sys/windows"
"log"
"net"
"syscall"
"time"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
//sys internetGetConnectedState(flags *uint32, reserved uint32) (connected bool) = wininet.InternetGetConnectedState
diff --git a/conf/dpapi/dpapi_windows.go b/conf/dpapi/dpapi_windows.go
index 03a5d8a..0507471 100644
--- a/conf/dpapi/dpapi_windows.go
+++ b/conf/dpapi/dpapi_windows.go
@@ -7,9 +7,10 @@ package dpapi
import (
"errors"
- "golang.org/x/sys/windows"
"runtime"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
const (
diff --git a/conf/dpapi/dpapi_windows_test.go b/conf/dpapi/dpapi_windows_test.go
index e0e9b42..8356f2d 100644
--- a/conf/dpapi/dpapi_windows_test.go
+++ b/conf/dpapi/dpapi_windows_test.go
@@ -7,9 +7,10 @@ package dpapi
import (
"bytes"
- "golang.org/x/sys/windows"
"testing"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
func TestRoundTrip(t *testing.T) {
diff --git a/conf/path_windows.go b/conf/path_windows.go
index 8b23e39..1345db1 100644
--- a/conf/path_windows.go
+++ b/conf/path_windows.go
@@ -7,10 +7,11 @@ package conf
import (
"errors"
- "golang.org/x/sys/windows"
"os"
"path/filepath"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
//sys coTaskMemFree(pointer uintptr) = ole32.CoTaskMemFree
diff --git a/conf/store.go b/conf/store.go
index 43f524c..9c645a6 100644
--- a/conf/store.go
+++ b/conf/store.go
@@ -7,11 +7,12 @@ package conf
import (
"errors"
- "golang.zx2c4.com/wireguard/windows/conf/dpapi"
"io/ioutil"
"os"
"path/filepath"
"strings"
+
+ "golang.zx2c4.com/wireguard/windows/conf/dpapi"
)
const configFileSuffix = ".conf.dpapi"
diff --git a/conf/storewatcher_windows.go b/conf/storewatcher_windows.go
index 5c5ffac..26e94cd 100644
--- a/conf/storewatcher_windows.go
+++ b/conf/storewatcher_windows.go
@@ -6,8 +6,9 @@
package conf
import (
- "golang.org/x/sys/windows"
"log"
+
+ "golang.org/x/sys/windows"
)
const (
diff --git a/main.go b/main.go
index 1e06d62..7780354 100644
--- a/main.go
+++ b/main.go
@@ -7,16 +7,17 @@ package main
import (
"fmt"
- "golang.org/x/sys/windows"
- "golang.zx2c4.com/wireguard/windows/ringlogger"
- "golang.zx2c4.com/wireguard/windows/service"
- "golang.zx2c4.com/wireguard/windows/ui"
"os"
"runtime"
"strconv"
"strings"
"time"
"unsafe"
+
+ "golang.org/x/sys/windows"
+ "golang.zx2c4.com/wireguard/windows/ringlogger"
+ "golang.zx2c4.com/wireguard/windows/service"
+ "golang.zx2c4.com/wireguard/windows/ui"
)
var flags = [...]string{
diff --git a/ringlogger/dump_windows.go b/ringlogger/dump_windows.go
index 1ee1f01..7faf8ff 100644
--- a/ringlogger/dump_windows.go
+++ b/ringlogger/dump_windows.go
@@ -6,12 +6,13 @@
package ringlogger
import (
- "golang.org/x/sys/windows"
- "golang.org/x/sys/windows/registry"
- "golang.zx2c4.com/wireguard/windows/conf"
"io"
"os"
"path"
+
+ "golang.org/x/sys/windows"
+ "golang.org/x/sys/windows/registry"
+ "golang.zx2c4.com/wireguard/windows/conf"
)
func DumpTo(out io.Writer, localSystem bool) error {
diff --git a/ringlogger/global.go b/ringlogger/global.go
index da79b6d..8d8f8ec 100644
--- a/ringlogger/global.go
+++ b/ringlogger/global.go
@@ -6,9 +6,10 @@
package ringlogger
import (
- "golang.zx2c4.com/wireguard/windows/conf"
"log"
"path"
+
+ "golang.zx2c4.com/wireguard/windows/conf"
)
var Global *Ringlogger
diff --git a/ringlogger/ringlogger_windows.go b/ringlogger/ringlogger_windows.go
index 4c142e6..e3b79cf 100644
--- a/ringlogger/ringlogger_windows.go
+++ b/ringlogger/ringlogger_windows.go
@@ -8,7 +8,6 @@ package ringlogger
import (
"bytes"
"fmt"
- "golang.org/x/sys/windows"
"io"
"os"
"runtime"
@@ -16,6 +15,8 @@ import (
"sync/atomic"
"time"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
const (
diff --git a/service/errors.go b/service/errors.go
index 670c330..339b61b 100644
--- a/service/errors.go
+++ b/service/errors.go
@@ -7,8 +7,9 @@ package service
import (
"fmt"
- "golang.org/x/sys/windows"
"syscall"
+
+ "golang.org/x/sys/windows"
)
type Error uint32
diff --git a/service/firewall/helpers.go b/service/firewall/helpers.go
index 7b88271..c996866 100644
--- a/service/firewall/helpers.go
+++ b/service/firewall/helpers.go
@@ -7,11 +7,12 @@ package firewall
import (
"fmt"
- "golang.org/x/sys/windows"
"os"
"runtime"
"syscall"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
func runTransaction(session uintptr, operation wfpObjectInstaller) error {
diff --git a/service/firewall/rules.go b/service/firewall/rules.go
index 364c7d1..00ca19e 100644
--- a/service/firewall/rules.go
+++ b/service/firewall/rules.go
@@ -8,11 +8,12 @@ package firewall
import (
"encoding/binary"
"errors"
- "golang.org/x/sys/windows"
- "golang.zx2c4.com/wireguard/windows/version"
"net"
"runtime"
"unsafe"
+
+ "golang.org/x/sys/windows"
+ "golang.zx2c4.com/wireguard/windows/version"
)
//
diff --git a/service/install.go b/service/install.go
index e20658e..a989ac0 100644
--- a/service/install.go
+++ b/service/install.go
@@ -7,13 +7,14 @@ package service
import (
"errors"
+ "os"
+ "syscall"
+ "time"
+
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/mgr"
"golang.zx2c4.com/wireguard/windows/conf"
- "os"
- "syscall"
- "time"
)
var cachedServiceManager *mgr.Mgr
diff --git a/service/ipc_client.go b/service/ipc_client.go
index adfd456..268f18e 100644
--- a/service/ipc_client.go
+++ b/service/ipc_client.go
@@ -8,10 +8,11 @@ package service
import (
"encoding/gob"
"errors"
- "golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/updater"
"net/rpc"
"os"
+
+ "golang.zx2c4.com/wireguard/windows/conf"
+ "golang.zx2c4.com/wireguard/windows/updater"
)
type Tunnel struct {
diff --git a/service/ipc_pipe.go b/service/ipc_pipe.go
index 00f54bf..ecf2471 100644
--- a/service/ipc_pipe.go
+++ b/service/ipc_pipe.go
@@ -6,9 +6,10 @@
package service
import (
- "golang.org/x/sys/windows"
"os"
"strconv"
+
+ "golang.org/x/sys/windows"
)
type pipeRWC struct {
diff --git a/service/ipc_server.go b/service/ipc_server.go
index 12e01ce..9d9f7d9 100644
--- a/service/ipc_server.go
+++ b/service/ipc_server.go
@@ -9,11 +9,6 @@ import (
"bytes"
"encoding/gob"
"fmt"
- "github.com/Microsoft/go-winio"
- "golang.org/x/sys/windows"
- "golang.org/x/sys/windows/svc"
- "golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/updater"
"io/ioutil"
"log"
"net/rpc"
@@ -22,6 +17,12 @@ import (
"sync/atomic"
"syscall"
"time"
+
+ "github.com/Microsoft/go-winio"
+ "golang.org/x/sys/windows"
+ "golang.org/x/sys/windows/svc"
+ "golang.zx2c4.com/wireguard/windows/conf"
+ "golang.zx2c4.com/wireguard/windows/updater"
)
var managerServices = make(map[*ManagerService]bool)
diff --git a/service/names.go b/service/names.go
index ced657a..e93ed66 100644
--- a/service/names.go
+++ b/service/names.go
@@ -7,6 +7,7 @@ package service
import (
"errors"
+
"golang.zx2c4.com/wireguard/windows/conf"
)
diff --git a/service/securityapi.go b/service/securityapi.go
index 2c1db5d..b717119 100644
--- a/service/securityapi.go
+++ b/service/securityapi.go
@@ -7,9 +7,10 @@ package service
import (
"errors"
- "golang.org/x/sys/windows"
"runtime"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
const (
diff --git a/service/service_manager.go b/service/service_manager.go
index a364271..0284810 100644
--- a/service/service_manager.go
+++ b/service/service_manager.go
@@ -7,10 +7,6 @@ package service
import (
"errors"
- "golang.org/x/sys/windows"
- "golang.org/x/sys/windows/svc"
- "golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/ringlogger"
"log"
"os"
"runtime"
@@ -19,6 +15,11 @@ import (
"syscall"
"time"
"unsafe"
+
+ "golang.org/x/sys/windows"
+ "golang.org/x/sys/windows/svc"
+ "golang.zx2c4.com/wireguard/windows/conf"
+ "golang.zx2c4.com/wireguard/windows/ringlogger"
)
type managerService struct{}
diff --git a/service/service_tunnel.go b/service/service_tunnel.go
index 01e7b41..c7b469f 100644
--- a/service/service_tunnel.go
+++ b/service/service_tunnel.go
@@ -9,13 +9,6 @@ import (
"bufio"
"bytes"
"fmt"
- "golang.org/x/sys/windows/svc"
- "golang.zx2c4.com/winipcfg"
- "golang.zx2c4.com/wireguard/device"
- "golang.zx2c4.com/wireguard/ipc"
- "golang.zx2c4.com/wireguard/tun"
- "golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/ringlogger"
"log"
"net"
"os"
@@ -23,6 +16,14 @@ import (
"runtime/debug"
"strings"
"time"
+
+ "golang.org/x/sys/windows/svc"
+ "golang.zx2c4.com/winipcfg"
+ "golang.zx2c4.com/wireguard/device"
+ "golang.zx2c4.com/wireguard/ipc"
+ "golang.zx2c4.com/wireguard/tun"
+ "golang.zx2c4.com/wireguard/windows/conf"
+ "golang.zx2c4.com/wireguard/windows/ringlogger"
)
type tunnelService struct {
diff --git a/service/tunneltracker.go b/service/tunneltracker.go
index 1c36858..e0f5414 100644
--- a/service/tunneltracker.go
+++ b/service/tunneltracker.go
@@ -7,15 +7,16 @@ package service
import (
"fmt"
- "golang.org/x/sys/windows"
- "golang.org/x/sys/windows/svc"
- "golang.org/x/sys/windows/svc/mgr"
- "golang.zx2c4.com/wireguard/windows/conf"
"log"
"runtime"
"sync"
"syscall"
"time"
+
+ "golang.org/x/sys/windows"
+ "golang.org/x/sys/windows/svc"
+ "golang.org/x/sys/windows/svc/mgr"
+ "golang.zx2c4.com/wireguard/windows/conf"
)
//sys notifyServiceStatusChange(service windows.Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) = advapi32.NotifyServiceStatusChangeW
diff --git a/service/updatestate.go b/service/updatestate.go
index c046edb..4d9330f 100644
--- a/service/updatestate.go
+++ b/service/updatestate.go
@@ -6,10 +6,11 @@
package service
import (
- "golang.zx2c4.com/wireguard/windows/updater"
- "golang.zx2c4.com/wireguard/windows/version"
"log"
"time"
+
+ "golang.zx2c4.com/wireguard/windows/updater"
+ "golang.zx2c4.com/wireguard/windows/version"
)
type UpdateState uint32
diff --git a/ui/iconprovider.go b/ui/iconprovider.go
index 97738f8..3b3fd13 100644
--- a/ui/iconprovider.go
+++ b/ui/iconprovider.go
@@ -7,12 +7,13 @@ package ui
import (
"fmt"
+ "path"
+ "syscall"
+
"github.com/lxn/walk"
"github.com/lxn/win"
"golang.org/x/sys/windows"
"golang.zx2c4.com/wireguard/windows/service"
- "path"
- "syscall"
)
type widthAndState struct {
diff --git a/ui/listview.go b/ui/listview.go
index 6870e91..99e8818 100644
--- a/ui/listview.go
+++ b/ui/listview.go
@@ -6,10 +6,11 @@
package ui
import (
- "golang.zx2c4.com/wireguard/windows/conf"
"sort"
"sync/atomic"
+ "golang.zx2c4.com/wireguard/windows/conf"
+
"github.com/lxn/walk"
"golang.zx2c4.com/wireguard/windows/service"
)
diff --git a/ui/tray.go b/ui/tray.go
index f2c387e..698f14d 100644
--- a/ui/tray.go
+++ b/ui/tray.go
@@ -7,11 +7,12 @@ package ui
import (
"fmt"
- "golang.zx2c4.com/wireguard/windows/conf"
"sort"
"strings"
"time"
+ "golang.zx2c4.com/wireguard/windows/conf"
+
"github.com/lxn/walk"
"golang.zx2c4.com/wireguard/windows/service"
)
diff --git a/ui/tunnelspage.go b/ui/tunnelspage.go
index ab0254c..192f642 100644
--- a/ui/tunnelspage.go
+++ b/ui/tunnelspage.go
@@ -8,15 +8,16 @@ package ui
import (
"archive/zip"
"fmt"
- "github.com/lxn/walk"
- "github.com/lxn/win"
- "golang.zx2c4.com/wireguard/windows/conf"
- "golang.zx2c4.com/wireguard/windows/service"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
+
+ "github.com/lxn/walk"
+ "github.com/lxn/win"
+ "golang.zx2c4.com/wireguard/windows/conf"
+ "golang.zx2c4.com/wireguard/windows/service"
)
type TunnelsPage struct {
diff --git a/ui/ui.go b/ui/ui.go
index 972a708..741f254 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -7,13 +7,14 @@ package ui
import (
"fmt"
+ "runtime"
+ "runtime/debug"
+ "time"
+
"github.com/lxn/walk"
"github.com/lxn/win"
"golang.zx2c4.com/wireguard/windows/service"
"golang.zx2c4.com/wireguard/windows/version"
- "runtime"
- "runtime/debug"
- "time"
)
var noTrayAvailable = false
diff --git a/ui/updatepage.go b/ui/updatepage.go
index b228fb2..b50427c 100644
--- a/ui/updatepage.go
+++ b/ui/updatepage.go
@@ -7,6 +7,7 @@ package ui
import (
"fmt"
+
"github.com/lxn/walk"
"golang.zx2c4.com/wireguard/windows/service"
"golang.zx2c4.com/wireguard/windows/updater"
diff --git a/updater/downloader.go b/updater/downloader.go
index 88931d6..f9b7083 100644
--- a/updater/downloader.go
+++ b/updater/downloader.go
@@ -9,13 +9,14 @@ import (
"crypto/hmac"
"errors"
"fmt"
- "golang.org/x/crypto/blake2b"
- "golang.zx2c4.com/wireguard/windows/version"
"hash"
"io"
"net/http"
"os"
"sync/atomic"
+
+ "golang.org/x/crypto/blake2b"
+ "golang.zx2c4.com/wireguard/windows/version"
)
type DownloadProgress struct {
diff --git a/updater/msirunner_windows.go b/updater/msirunner_windows.go
index 1ea405f..92fd4e0 100644
--- a/updater/msirunner_windows.go
+++ b/updater/msirunner_windows.go
@@ -9,14 +9,15 @@ import (
"crypto/rand"
"encoding/hex"
"errors"
- "github.com/Microsoft/go-winio"
- "golang.org/x/sys/windows"
"os"
"os/exec"
"path"
"runtime"
"syscall"
"unsafe"
+
+ "github.com/Microsoft/go-winio"
+ "golang.org/x/sys/windows"
)
func runMsi(msiPath string, userToken uintptr) error {
diff --git a/updater/signify.go b/updater/signify.go
index 5fc16ba..8a62f4a 100644
--- a/updater/signify.go
+++ b/updater/signify.go
@@ -10,9 +10,10 @@ import (
"encoding/base64"
"encoding/hex"
"errors"
+ "strings"
+
"golang.org/x/crypto/blake2b"
"golang.org/x/crypto/ed25519"
- "strings"
)
/*
diff --git a/updater/versions.go b/updater/versions.go
index 3d1fd38..6ff7339 100644
--- a/updater/versions.go
+++ b/updater/versions.go
@@ -8,10 +8,11 @@ package updater
import (
"errors"
"fmt"
- "golang.zx2c4.com/wireguard/windows/version"
"runtime"
"strconv"
"strings"
+
+ "golang.zx2c4.com/wireguard/windows/version"
)
func versionNewerThanUs(candidate string) (bool, error) {
diff --git a/version/debugging_linux.go b/version/debugging_linux.go
index a504504..4564b81 100644
--- a/version/debugging_linux.go
+++ b/version/debugging_linux.go
@@ -8,6 +8,7 @@ package version
import (
"bytes"
"fmt"
+
"golang.org/x/sys/unix"
)
diff --git a/version/official_windows.go b/version/official_windows.go
index 4a68388..b0f6225 100644
--- a/version/official_windows.go
+++ b/version/official_windows.go
@@ -6,10 +6,11 @@
package version
import (
- "golang.org/x/sys/windows"
- "golang.zx2c4.com/wireguard/windows/version/wintrust"
"os"
"unsafe"
+
+ "golang.org/x/sys/windows"
+ "golang.zx2c4.com/wireguard/windows/version/wintrust"
)
const (
diff --git a/version/os_windows.go b/version/os_windows.go
index e46365b..27c64dc 100644
--- a/version/os_windows.go
+++ b/version/os_windows.go
@@ -7,8 +7,9 @@ package version
import (
"fmt"
- "golang.org/x/sys/windows/registry"
"unsafe"
+
+ "golang.org/x/sys/windows/registry"
)
const (
diff --git a/version/useragent.go b/version/useragent.go
index 321bc0a..83d9da5 100644
--- a/version/useragent.go
+++ b/version/useragent.go
@@ -7,8 +7,9 @@ package version
import (
"fmt"
- "golang.zx2c4.com/wireguard/device"
"runtime"
+
+ "golang.zx2c4.com/wireguard/device"
)
func UserAgent() string {
diff --git a/version/version_windows.go b/version/version_windows.go
index e567e7a..9a2c810 100644
--- a/version/version_windows.go
+++ b/version/version_windows.go
@@ -8,11 +8,12 @@ package version
import (
"errors"
"fmt"
- "golang.org/x/sys/windows"
"os"
"runtime"
"strings"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
//sys GetFileVersionInfoSize(filename *uint16, zero *uint32) (size uint32, err error) = version.GetFileVersionInfoSizeW
diff --git a/version/wintrust/certificate_windows.go b/version/wintrust/certificate_windows.go
index 8a0b5f2..ab7c10d 100644
--- a/version/wintrust/certificate_windows.go
+++ b/version/wintrust/certificate_windows.go
@@ -7,9 +7,10 @@ package wintrust
import (
"crypto/x509"
- "golang.org/x/sys/windows"
"syscall"
"unsafe"
+
+ "golang.org/x/sys/windows"
)
const (
diff --git a/version/wintrust/wintrust_windows.go b/version/wintrust/wintrust_windows.go
index b50636a..abb413b 100644
--- a/version/wintrust/wintrust_windows.go
+++ b/version/wintrust/wintrust_windows.go
@@ -6,8 +6,9 @@
package wintrust
import (
- "golang.org/x/sys/windows"
"syscall"
+
+ "golang.org/x/sys/windows"
)
type WinTrustData struct {