code: func (l hcl2Loader) loadFile(filename string) (configurable, []string, error) {
  	var f *hcl2.File
  	var diags hcl2.Diagnostics
  	if strings.HasSuffix(filename, ".json") {
  		f, diags = l.Parser.ParseJSONFile(filename)
  	} else {
  		f, diags = l.Parser.ParseHCLFile(filename)
  	}
  	if diags.HasErrors() {
  		// Return diagnostics as an error; callers may type-assert this to
  		// recover the original diagnostics, if it doesn't end up wrapped
  		// in another error.
  		return nil, nil, diags
  	}
  
  	return &hcl2Configurable{
  		SourceFilename: filename,
  		Body:           f.Body,
  	}, nil, nil
  }
docs: // loadFile is a fileLoaderFunc that knows how to read a HCL2 file and turn it
  // into a hcl2Configurable.