Skip to content

Commit

Permalink
Update Go module version to 1.17 (microsoft#1222)
Browse files Browse the repository at this point in the history
Update Go module version to 1.17

This change does three things:

1. Runs gofmt on Go 1.17 in /internal, /cmd, /hcn, and /test. Go 1.17 added a new syntax for build tags that gofmt automatically applies. The new format will just be ignored on older builds and 1.17 and up will prefer the new syntax (which is much nicer if I may add), so this should be harmless.

2. Updates the go directive in our go.mod to be 1.17. We don't currently make use of any 1.17 features but we plan to (as well as the 1.16 io/fs additions).

3. Runs go mod vendor in the root of the repo and in /test for the new module graph pruning (https://go.dev/ref/mod#graph-pruning)

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
  • Loading branch information
dcantah authored Jan 15, 2022
1 parent f6ffb1f commit 268a618
Show file tree
Hide file tree
Showing 59 changed files with 68 additions and 11 deletions.
1 change: 1 addition & 0 deletions credentials/credentials.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

// Package credentials holds the necessary structs and functions for adding
Expand Down
1 change: 1 addition & 0 deletions devices/assigned_devices.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package devices
Expand Down
1 change: 1 addition & 0 deletions devices/drivers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package devices
Expand Down
1 change: 1 addition & 0 deletions devices/pnp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package devices
Expand Down
1 change: 1 addition & 0 deletions guest/bridge/bridge.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

// Package bridge defines the bridge struct, which implements the control loop
Expand Down
1 change: 1 addition & 0 deletions guest/bridge/bridge_unit_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package bridge
Expand Down
1 change: 1 addition & 0 deletions guest/bridge/bridge_v2.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package bridge
Expand Down
1 change: 1 addition & 0 deletions guest/network/netns.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package network
Expand Down
1 change: 1 addition & 0 deletions guest/network/network.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package network
Expand Down
1 change: 1 addition & 0 deletions guest/network/network_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package network
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/container.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/network.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/network_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/nvidia_utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/process.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/sandbox_container.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/spec.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/standalone_container.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/uvm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/hcsv2/workload_container.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package hcsv2
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/runc/ioutils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package runc
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/runc/runc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

// Package runc defines an implementation of the Runtime interface which uses
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/runc/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package runc
Expand Down
1 change: 1 addition & 0 deletions guest/runtime/runtime.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

// Package runtime defines the interface between the GCS and an OCI container
Expand Down
1 change: 1 addition & 0 deletions guest/stdio/connection.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package stdio
Expand Down
1 change: 1 addition & 0 deletions guest/stdio/stdio.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package stdio
Expand Down
1 change: 1 addition & 0 deletions guest/stdio/tty.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package stdio
Expand Down
1 change: 1 addition & 0 deletions guest/storage/crypt/crypt.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package crypt
Expand Down
1 change: 1 addition & 0 deletions guest/storage/crypt/crypt_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package crypt
Expand Down
1 change: 1 addition & 0 deletions guest/storage/crypt/utilities.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package crypt
Expand Down
1 change: 1 addition & 0 deletions guest/storage/devicemapper/devicemapper.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package devicemapper
Expand Down
1 change: 1 addition & 0 deletions guest/storage/devicemapper/devicemapper_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package devicemapper
Expand Down
1 change: 1 addition & 0 deletions guest/storage/devicemapper/targets.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package devicemapper
Expand Down
1 change: 1 addition & 0 deletions guest/storage/mount.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package storage
Expand Down
1 change: 1 addition & 0 deletions guest/storage/mount_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package storage
Expand Down
1 change: 1 addition & 0 deletions guest/storage/overlay/overlay.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package overlay
Expand Down
1 change: 1 addition & 0 deletions guest/storage/overlay/overlay_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package overlay
Expand Down
1 change: 1 addition & 0 deletions guest/storage/pci/pci.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package pci
Expand Down
1 change: 1 addition & 0 deletions guest/storage/pci/pci_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package pci
Expand Down
1 change: 1 addition & 0 deletions guest/storage/plan9/plan9.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package plan9
Expand Down
1 change: 1 addition & 0 deletions guest/storage/pmem/pmem.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package pmem
Expand Down
1 change: 1 addition & 0 deletions guest/storage/pmem/pmem_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package pmem
Expand Down
1 change: 1 addition & 0 deletions guest/storage/scsi/scsi.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package scsi
Expand Down
1 change: 1 addition & 0 deletions guest/storage/scsi/scsi_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package scsi
Expand Down
1 change: 1 addition & 0 deletions guest/storage/utilities.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package storage
Expand Down
1 change: 1 addition & 0 deletions guest/storage/utilities_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package storage
Expand Down
1 change: 1 addition & 0 deletions guest/storage/vmbus/vmbus.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package vmbus
Expand Down
1 change: 1 addition & 0 deletions guest/storage/vmbus/vmbus_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package vmbus
Expand Down
1 change: 1 addition & 0 deletions hcsoci/clone.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
1 change: 1 addition & 0 deletions hcsoci/create.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
1 change: 1 addition & 0 deletions hcsoci/hcsdoc_lcow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
1 change: 1 addition & 0 deletions hcsoci/hcsdoc_wcow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
1 change: 1 addition & 0 deletions hcsoci/resources_lcow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
1 change: 1 addition & 0 deletions hcsoci/resources_wcow.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package hcsoci
Expand Down
18 changes: 9 additions & 9 deletions hns/hnspolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ type ACLPolicy struct {
InternalPort uint16 `json:",omitempty"`
Action ActionType
Direction DirectionType
LocalAddresses string `json:",omitempty"`
RemoteAddresses string `json:",omitempty"`
LocalPorts string `json:"LocalPorts,omitempty"`
LocalPort uint16 `json:",omitempty"`
RemotePorts string `json:"RemotePorts,omitempty"`
RemotePort uint16 `json:",omitempty"`
RuleType RuleType `json:"RuleType,omitempty"`
Priority uint16 `json:",omitempty"`
ServiceName string `json:",omitempty"`
LocalAddresses string `json:",omitempty"`
RemoteAddresses string `json:",omitempty"`
LocalPorts string `json:"LocalPorts,omitempty"`
LocalPort uint16 `json:",omitempty"`
RemotePorts string `json:"RemotePorts,omitempty"`
RemotePort uint16 `json:",omitempty"`
RuleType RuleType `json:"RuleType,omitempty"`
Priority uint16 `json:",omitempty"`
ServiceName string `json:",omitempty"`
}

type Policy struct {
Expand Down
1 change: 1 addition & 0 deletions layers/layers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

// Package layers deals with container layer mounting/unmounting for LCOW and WCOW
Expand Down
1 change: 1 addition & 0 deletions safefile/safeopen_admin_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build admin
// +build admin

package safefile
Expand Down
1 change: 1 addition & 0 deletions schemaversion/schemaversion.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

package schemaversion
Expand Down
4 changes: 2 additions & 2 deletions vmservice/vmservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 268a618

Please sign in to comment.