srcarchive

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(path string) error

Add inserts the file with the given `path` into the source archive, returning a non-nil error value if it fails

func AppendablePath

func AppendablePath(path string) string

AppendablePath transforms the given path and also replaces colons with underscores to make it possible to append it to a base path on Windows

func TransformPath

func TransformPath(path string) string

TransformPath applies the transformations specified by `SEMMLE_PATH_TRANSFORMER` (if any) to the given path

Types

type ProjectLayout

type ProjectLayout struct {
	// contains filtered or unexported fields
}

ProjectLayout describes a very simple project layout rewriting paths starting with `from` to start with `to` instead.

We currently only support project layouts of the form

# to from//

func LoadProjectLayout

func LoadProjectLayout(file *os.File) (*ProjectLayout, error)

LoadProjectLayout loads a project layout from the given file, returning an error if the file does not have the right format

func (*ProjectLayout) Transform

func (p *ProjectLayout) Transform(path string) string

Transform transforms the given path according to the project layout: if it starts with the `from` prefix, that prefix is relaced by `to`; otherwise the path is returned unchanged.

Unlike the (internal) method `transformString`, this method handles Windows paths sensibly.

Jump to

Keyboard shortcuts

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