Skip to content

Commit 8cc9272

Browse files
committed
style: place const block before var block per code standard
1 parent b7d2c0f commit 8cc9272

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

hypervisor/cloudhypervisor/cloudhypervisor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111
storejson "github.com/cocoonstack/cocoon/storage/json"
1212
)
1313

14+
const typ = "cloud-hypervisor"
15+
1416
// compile-time interface checks.
1517
var (
1618
_ hypervisor.Hypervisor = (*CloudHypervisor)(nil)
1719
_ hypervisor.Direct = (*CloudHypervisor)(nil)
1820
_ hypervisor.Watchable = (*CloudHypervisor)(nil)
1921
)
2022

21-
const typ = "cloud-hypervisor"
22-
2323
// CloudHypervisor implements hypervisor.Hypervisor.
2424
type CloudHypervisor struct {
2525
*hypervisor.Backend

hypervisor/firecracker/firecracker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111
storejson "github.com/cocoonstack/cocoon/storage/json"
1212
)
1313

14+
const typ = "firecracker"
15+
1416
// compile-time interface checks.
1517
var (
1618
_ hypervisor.Hypervisor = (*Firecracker)(nil)
1719
_ hypervisor.Watchable = (*Firecracker)(nil)
1820
_ hypervisor.Direct = (*Firecracker)(nil)
1921
)
2022

21-
const typ = "firecracker"
22-
2323
// Firecracker implements hypervisor.Hypervisor using the Firecracker VMM.
2424
// Only OCI images (direct kernel boot) are supported — no UEFI, no cloudimg, no Windows.
2525
type Firecracker struct {

images/cloudimg/cloudimg.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
"github.com/cocoonstack/cocoon/utils"
1818
)
1919

20-
var _ images.Images = (*CloudImg)(nil)
21-
2220
const typ = "cloudimg"
2321

22+
var _ images.Images = (*CloudImg)(nil)
23+
2424
// CloudImg stores cloud image blobs for UEFI boot under Cloud Hypervisor.
2525
type CloudImg struct {
2626
conf *Config

images/oci/oci.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import (
1818
"github.com/cocoonstack/cocoon/utils"
1919
)
2020

21-
var _ images.Images = (*OCI)(nil)
22-
2321
const (
2422
typ = "oci"
2523
serialPrefix = "cocoon-layer"
2624
)
2725

26+
var _ images.Images = (*OCI)(nil)
27+
2828
// OCI implements the images.Images interface using OCI container images
2929
// converted to EROFS filesystems for use with Cloud Hypervisor.
3030
type OCI struct {

network/bridge/bridge_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
"github.com/cocoonstack/cocoon/types"
1818
)
1919

20-
var _ network.Network = (*Bridge)(nil)
21-
2220
const typ = "bridge"
2321

22+
var _ network.Network = (*Bridge)(nil)
23+
2424
// Bridge implements network.Network by creating TAP devices and adding
2525
// them directly to an existing Linux bridge. An external DHCP server
2626
// on the bridge (e.g. dnsmasq) serves VM IPs. No veth, no TC, no

network/cni/cni.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"github.com/cocoonstack/cocoon/utils"
2424
)
2525

26-
var _ network.Network = (*CNI)(nil)
27-
2826
const typ = "cni"
2927

28+
var _ network.Network = (*CNI)(nil)
29+
3030
// CNI implements network.Network using CNI plugins with per-VM netns + bridge + tap.
3131
type CNI struct {
3232
conf *Config

0 commit comments

Comments
 (0)