MCPcopy Index your code
hub / github.com/coder/coder / previewFileContent

Function previewFileContent

provisioner/terraform/tfparse/tfparse.go:511–517  ·  view source on GitHub ↗
(fileRange hcl.Range)

Source from the content-addressed store, hash-verified

509}
510
511func previewFileContent(fileRange hcl.Range) (string, error) {
512 body, err := os.ReadFile(fileRange.Filename)
513 if err != nil {
514 return "", err
515 }
516 return string(fileRange.SliceBytes(body)), nil
517}
518
519// convertTerraformVariable converts a Terraform variable to a template-wide variable, processed by Coder.
520func convertTerraformVariable(variable *tfconfig.Variable) (*proto.TemplateVariable, error) {

Callers 2

WorkspaceTagsMethod · 0.85

Calls 1

ReadFileMethod · 0.65

Tested by

no test coverage detected