fleet/cmd/gitops-migrate/limit/nocopy.go
Anthony Maxwell 288ea58bce
Feat: GitOps YAML Migration Tool (#32237)
# Overview

This pull request resolves #31165, implementing command-line tooling to
migrate GitOps YAML files following the [changes introduced in the
upcoming 4.74
release](https://github.com/fleetdm/fleet/pull/32237/files#diff-8769f6e90e8bdf15faad8f390fdf3ffb6fd2238b7d6087d83518c21464109119R7).

Aligning with the recommended steps in the `README`; [this is an example
of the first step](https://github.com/Illbjorn/fleet/pull/3/files)
(`gitops-migrate format`) and [this is an example of the second
step](https://github.com/Illbjorn/fleet/pull/4/files) (`gitops-migrate
migrate`).

---------

Signed-off-by: Illbjorn <am@hades.so>
Co-authored-by: Ian Littman <iansltx@gmail.com>
2025-09-08 12:42:25 -04:00

19 lines
551 B
Go

package limit
import "sync"
var _ sync.Locker = noCopy{}
// noCopy impmlements the 'sync.Locker' interface. Its purpose is to inform the
// various Go tools that it, and anything it is nested within, should _not_ be
// copied.
//
// As a quick demonstration: if you change any method in 'limit.go' to a value
// receiver, rather than a pointer receiver, and run the following, you'll see
// an error logged about the copy:
//
// $ go vet -copylocks ./cmd/gitops-migrate/...
type noCopy struct{}
func (noCopy) Lock() {}
func (noCopy) Unlock() {}