1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

refactor: orderedmap package -> omap

This commit is contained in:
Pete Davison
2024-01-04 00:31:24 +00:00
parent 1a03c3fbaf
commit 7cb45a23b6
8 changed files with 20 additions and 20 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/go-task/task/v3/internal/execext"
"github.com/go-task/task/v3/internal/filepathext"
"github.com/go-task/task/v3/internal/orderedmap"
omap "github.com/go-task/task/v3/internal/omap"
"gopkg.in/yaml.v3"
)
@@ -27,7 +27,7 @@ type Include struct {
// Includes represents information about included tasksfiles
type Includes struct {
orderedmap.OrderedMap[string, Include]
omap.OrderedMap[string, Include]
}
// UnmarshalYAML implements the yaml.Unmarshaler interface.

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/internal/orderedmap"
"github.com/go-task/task/v3/internal/omap"
"github.com/go-task/task/v3/taskfile/ast"
)
@@ -39,7 +39,7 @@ vars:
&ast.Cmd{},
&ast.Cmd{
Task: "another-task", Vars: &ast.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "VALUE1"},
"PARAM2": {Value: "VALUE2"},
@@ -59,7 +59,7 @@ vars:
&ast.Cmd{},
&ast.Cmd{
Task: "some_task", Vars: &ast.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "var"},
},
@@ -79,7 +79,7 @@ vars:
&ast.Dep{},
&ast.Dep{
Task: "another-task", Vars: &ast.Vars{
OrderedMap: orderedmap.FromMapWithOrder(
OrderedMap: omap.FromMapWithOrder(
map[string]ast.Var{
"PARAM1": {Value: "VALUE1"},
"PARAM2": {Value: "VALUE2"},

View File

@@ -5,18 +5,18 @@ import (
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/internal/orderedmap"
"github.com/go-task/task/v3/internal/omap"
)
// Tasks represents a group of tasks
type Tasks struct {
orderedmap.OrderedMap[string, *Task]
omap.OrderedMap[string, *Task]
}
func (t *Tasks) UnmarshalYAML(node *yaml.Node) error {
switch node.Kind {
case yaml.MappingNode:
tasks := orderedmap.New[string, *Task]()
tasks := omap.New[string, *Task]()
if err := node.Decode(&tasks); err != nil {
return err
}

View File

@@ -7,12 +7,12 @@ import (
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/internal/experiments"
"github.com/go-task/task/v3/internal/orderedmap"
"github.com/go-task/task/v3/internal/omap"
)
// Vars is a string[string] variables map.
type Vars struct {
orderedmap.OrderedMap[string, Var]
omap.OrderedMap[string, Var]
}
// ToCacheMap converts Vars to a map containing only the static