/usr/share/gocode/src/github.com/go-chef/chef/reader_test.go is in golang-github-go-chef-chef-dev 0.0.1+git20161023.60.deb8c38-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | package chef
import (
"io"
"io/ioutil"
"os"
"testing"
)
type TestEncoder struct {
Name string
Awesome []string
OtherStuff map[string]string
}
func TestEncoderJSONReader(t *testing.T) {
f, err := ioutil.TempFile("test/", "reader")
if err != nil {
t.Error(err)
}
defer f.Close()
defer os.Remove(f.Name())
tr := &TestEncoder{
Name: "Test Reader",
Awesome: []string{"foo", "bar", "baz"},
OtherStuff: map[string]string{
"foo": "bar",
"baz": "banana",
},
}
// Generate body
body, err := JSONReader(tr)
if err != nil {
t.Error(err)
}
t.Log(body)
_, err = io.Copy(f, body)
if err != nil {
t.Error(err)
}
}
|