i have a simple struct in a package:
// Report …
type Report struct {
SysrptID json.Number json:"sysrptID"
Description string json:"Description"
FileName string json:"FileName"
Name string json:"Name"
}
// Reports defines a slice of Report
type Reports []*Report
i have this code in a data package with
this for the module
module comanyname/reports/report-api
and reports.go it is in a folder called data
in the package main
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"companyname/reports/report-api/data"
[it never finds this]
)
// JSONdataReports a []struct representing Reports
var JSONdataReports Reports
I get undefined Reports for the var
if i copy the types to the main.go file it works great
What in the world am i missing