package dynamic type Validatable interface { // If the object is returned invalid this function should return the reason IsValid() error } // Reads object fron the file and validates it func ReadValidJSONfromFile(fileLocation string, v Validatable) error { var err = ReadJSONfromFile(fileLocation, v) if err != nil { return err } return v.IsValid() }