github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/testutils/lint/passes/nocopy/testdata/src/a/a.go (about) 1 // Copyright 2020 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package a 12 13 import "github.com/cockroachdb/cockroach/pkg/util" 14 15 type onlyField struct { 16 _ util.NoCopy 17 } 18 19 type firstField struct { 20 _ util.NoCopy 21 a int64 22 } 23 24 type middleField struct { 25 a int64 26 _ util.NoCopy // want `Illegal use of util.NoCopy - must be first field in struct` 27 b int64 28 } 29 30 type lastField struct { 31 a int64 32 _ util.NoCopy // want `Illegal use of util.NoCopy - must be first field in struct` 33 } 34 35 type embeddedField struct { 36 util.NoCopy // want `Illegal use of util.NoCopy - should not be embedded` 37 } 38 39 type multiField struct { 40 _, _ util.NoCopy // want `Illegal use of util.NoCopy - should be included only once` 41 } 42 43 type namedField struct { 44 noCopy util.NoCopy // want `Illegal use of util.NoCopy - should be unnamed` 45 }