Skip to content

Commit 58c13b8

Browse files
committed
nocopy: init implementation
0 parents  commit 58c13b8

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiled Object files, Static and Dynamic libs (Shared Objects)
2+
*.o
3+
*.a
4+
*.so
5+
6+
# Folders
7+
_obj
8+
_test
9+
10+
# Architecture specific extensions/prefixes
11+
*.[568vq]
12+
[568vq].out
13+
14+
*.cgo1.go
15+
*.cgo2.c
16+
_cgo_defun.c
17+
_cgo_gotypes.go
18+
_cgo_export.*
19+
20+
_testmain.go
21+
22+
*.exe
23+
*.test
24+
*.prof

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Gramework Utils
2+
Some Good Utils

nocopy/nocopy.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package nocopy
2+
3+
// NoCopy is the type you should embed as a value (not as a pointer to it)
4+
// in a type you need to make checkable for go vet so it can see that you
5+
// should not copy the type anywhere
6+
type NoCopy struct{}
7+
8+
// Lock is an empty method that shows go vet that developer should not
9+
// copy the type where NoCopy was embedded
10+
func (*NoCopy) Lock() {}

0 commit comments

Comments
 (0)