Commit test code and go.mod
This commit is contained in:
parent
28241ba92e
commit
e44d286ab2
1
embed.txt
Normal file
1
embed.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
This is a test of //go:embed
|
3
go.mod
Normal file
3
go.mod
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module git.icomputeconsulting.com/bminer/go-embed-test
|
||||||
|
|
||||||
|
go 1.18
|
11
test.go
Normal file
11
test.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package embedtest
|
||||||
|
|
||||||
|
import _ "embed" // need to import embed
|
||||||
|
|
||||||
|
//go:embed embed.txt
|
||||||
|
var embed string
|
||||||
|
|
||||||
|
// Embed will return the contents of embed.txt
|
||||||
|
func Embed() string {
|
||||||
|
return embed
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user