Documentation
¶
Index ¶
Constants ¶
View Source
const ( Replace FileExistsAction = "replace" Skip FileExistsAction = "skip" ReplaceIfNewer FileExistsAction = "replace_if_newer" Commit ChangelogType = "commit" Tag ChangelogType = "tag" Include ChangelogConditionType = "include" Exclude ChangelogConditionType = "exclude" Asc SortingType = "asc" Desc SortingType = "desc" StripPrefix TransformType = "stripPrefix" StripSuffix TransformType = "stripSuffix" RemoveAll TransformType = "removeAll" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangelogConditionType ¶
type ChangelogConditionType string
type ChangelogType ¶
type ChangelogType string
type Changes ¶
func (*Changes) IsChangedFile ¶
IsChangedFile checks whether the given file path corresponds to a file that has been added or modified.
Parameters:
- path: The file path to check.
Returns:
- true if the file is in the list of added or modified files.
- false otherwise.
Behavior:
- Iterates through the `Added` and `Modified` slices of the `Changes` struct.
- Uses `strings.HasSuffix` to check if the provided path ends with any of the added or modified file names.
- Returns true on the first match, otherwise false.
Notes:
- This method assumes that `o.Added` and `o.Modified` contain relative or base file names.
- If files are stored with full paths in `o.Added` and `o.Modified`, this method may produce false negatives.
Example:
changes := Changes{
Added: []string{"file1.txt", "dir/file2.go"},
Modified: []string{"config.yaml"},
}
fmt.Println(changes.IsChangedFile("project/dir/file2.go")) // true
fmt.Println(changes.IsChangedFile("config.yaml")) // true
fmt.Println(changes.IsChangedFile("untracked.txt")) // false
type FileExistsAction ¶
type FileExistsAction string
type Path ¶ added in v1.5.1
type Path struct {
From string
To string
ActionIfExists FileExistsAction
Convert bool
}
type SortingType ¶ added in v1.4.4
type SortingType string
type TransformType ¶ added in v1.5.5
type TransformType string
type VersionLabel ¶ added in v1.4.4
type VersionLabel string
const ( Alpha VersionLabel = "alpha" Beta VersionLabel = "beta" Stable VersionLabel = "stable" )
type Versions ¶ added in v1.4.4
type Versions map[string]VersionLabel
Click to show internal directories.
Click to hide internal directories.