Help us shape the future of Go! Take the 2026 Go Developer Survey

helpers

package
v0.68.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateMetadataFilePaths

func GenerateMetadataFilePaths(dirName, baseName, metaExt, codeExt string, xmlContent, codeContent []byte) map[string][]byte

GenerateMetadataFilePaths generates the file paths for metadata and companion files.

Parameters:

  • dirName: The canonical directory name (e.g., "classes")
  • baseName: The base file name without extension (e.g., "MyClass")
  • metaExt: The metadata file extension (e.g., ".cls-meta.xml")
  • codeExt: The code file extension (e.g., ".cls")
  • xmlContent: The marshalled XML content
  • codeContent: The code content (can be nil)

Returns a map of file paths to content.

func LoadBundleFiles

func LoadBundleFiles(sourcePath string, skipPatterns ...string) (map[string][]byte, error)

LoadBundleFiles loads all files from a bundle directory (like LWC or Aura).

Parameters:

  • sourcePath: The path to the metadata file (e.g., "myComponent.js-meta.xml")
  • skipPatterns: Patterns to skip (e.g., "__tests__", "-meta.xml")

Returns a map of relative path to file content.

func LoadCompanionFile

func LoadCompanionFile(sourcePath, metaSuffix, fileExt string) []byte

LoadCompanionFile loads a companion file for metadata that has separate code files. For example, ApexClass has .cls-meta.xml (metadata) and .cls (code).

Parameters:

  • sourcePath: The path to the metadata file (e.g., "MyClass.cls-meta.xml")
  • metaSuffix: The metadata suffix to remove (e.g., "-meta.xml")
  • fileExt: The companion file extension (e.g., ".cls")

Returns the file content or nil if the file doesn't exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL