mirror of
https://github.com/go-task/task.git
synced 2026-05-18 21:26:37 +02:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
726130be09 | ||
|
|
968a29d869 | ||
|
|
ce27e973be | ||
|
|
2607866c49 | ||
|
|
e8e914b11c | ||
|
|
d22b3b0d88 | ||
|
|
5ece1d74f6 | ||
|
|
ac7ab42d94 | ||
|
|
38a3f538f5 | ||
|
|
998935ea55 | ||
|
|
e781ac2512 | ||
|
|
ef2695974d | ||
|
|
b552cc2b12 | ||
|
|
4ae9c2445d | ||
|
|
769e25f080 | ||
|
|
86a23849e0 | ||
|
|
a586fef414 | ||
|
|
a548c63a92 | ||
|
|
5268df6bfd | ||
|
|
82e1c0f810 | ||
|
|
81b0ffb7f4 | ||
|
|
0da130ee2c | ||
|
|
6e880c9027 | ||
|
|
082fa321cb | ||
|
|
ff1c49f111 | ||
|
|
50f592c540 | ||
|
|
7a7f66dfdc | ||
|
|
a1140aa62f | ||
|
|
2dd3564da1 | ||
|
|
fb4b0a187e | ||
|
|
ac48ee066e | ||
|
|
06031efc09 | ||
|
|
9bea80b862 | ||
|
|
92ecb1c7ec | ||
|
|
645f77b849 | ||
|
|
2f9381065d | ||
|
|
774ef61c2f |
46
CODE_OF_CONDUCT.md
Normal file
46
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at andrey.nering@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
11
CONTRIBUTING.md
Normal file
11
CONTRIBUTING.md
Normal file
@@ -0,0 +1,11 @@
|
||||
* Bug reports and feature requests are welcome in [the issues][issues]
|
||||
* For questions and discussion there's the [Slack room][slack]
|
||||
* Pull Requests are welcome. For more complex changes and features it's
|
||||
recommended to open an issue first
|
||||
* About 3 or 4 pull requests accepted one gets write access to the repo.
|
||||
Even then, possible backward incompatible changes should be discussed first
|
||||
in an issue or pull request
|
||||
* Documentation contributions are as important as code contributions
|
||||
|
||||
[issues]: https://github.com/go-task/task/issues
|
||||
[slack]: https://gophers.slack.com/messages/task
|
||||
14
Gopkg.lock
generated
14
Gopkg.lock
generated
@@ -4,8 +4,8 @@
|
||||
[[projects]]
|
||||
name = "github.com/Masterminds/semver"
|
||||
packages = ["."]
|
||||
revision = "abff1900528dbdaf6f3f5aa92c398be1eaf2a9f7"
|
||||
version = "v1.3.0"
|
||||
revision = "517734cc7d6470c0d07130e40fd40bdeb9bcd3fd"
|
||||
version = "v1.3.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -53,7 +53,7 @@
|
||||
branch = "master"
|
||||
name = "github.com/mvdan/sh"
|
||||
packages = ["interp","syntax"]
|
||||
revision = "6773c283e820450b8ab307ac68e502960d473470"
|
||||
revision = "cbdcf488deaebe5f51b5bb993f21d194f9f2211e"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/pmezard/go-difflib"
|
||||
@@ -83,13 +83,13 @@
|
||||
branch = "master"
|
||||
name = "golang.org/x/crypto"
|
||||
packages = ["pbkdf2","scrypt"]
|
||||
revision = "b286ef4198388fdb0e4ae62be12820df5da9b4c2"
|
||||
revision = "dd85ac7e6a88fc6ca420478e934de5f1a42dd3c6"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
packages = ["context"]
|
||||
revision = "570fa1c91359c1869590e9cedf3b53162a51a167"
|
||||
revision = "f01ecb60fe3835d80d9a0b7b2bf24b228c89260e"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
@@ -101,13 +101,13 @@
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
packages = ["unix"]
|
||||
revision = "6faef541c73732f438fb660a212750a9ba9f9362"
|
||||
revision = "4cd6d1a821c7175768725b55ca82f14683a29ea4"
|
||||
|
||||
[[projects]]
|
||||
branch = "v2"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
revision = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b"
|
||||
revision = "3b4ad1db5b2a649883ff3782f5f9f6fb52be71af"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
|
||||
65
README.md
65
README.md
@@ -1,7 +1,4 @@
|
||||
[](https://github.com/go-task/task/blob/master/LICENSE)
|
||||
[](https://gitter.im/go-task/task?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://gophers.slack.com/messages/task)
|
||||
[](http://www.somsubhra.com/github-release-stats/?username=go-task&repository=task)
|
||||
[](https://gophers.slack.com/messages/task)
|
||||
[](https://travis-ci.org/go-task/task)
|
||||
|
||||
# Task - Simple task runner / "Make" alternative
|
||||
@@ -35,6 +32,7 @@ go get -u -v github.com/go-task/task/cmd/task
|
||||
|
||||
Or you can download the binary from the [releases][releases] page and add to
|
||||
your `PATH`. DEB and RPM packages are also available.
|
||||
The `task_checksums.txt` file contains the SHA-256 checksum for each file.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -78,8 +76,8 @@ build:
|
||||
|
||||
### OS specific task
|
||||
|
||||
If you add a `Taskfile_{{GOOS}}` you can override or amend your taskfile based
|
||||
on the operating system.
|
||||
If you add a `Taskfile_{{GOOS}}.yml` you can override or amend your taskfile
|
||||
based on the operating system.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -99,7 +97,11 @@ build:
|
||||
- echo "linux"
|
||||
```
|
||||
|
||||
Will print out `linux` and not default
|
||||
Will print out `linux` and not default.
|
||||
|
||||
It's also possible to have OS specific `Taskvars.yml` file, like
|
||||
`Taskvars_windows.yml` or `Taskvars_darwin.yml`. See the
|
||||
[variables section](#variables) below.
|
||||
|
||||
### Task directory
|
||||
|
||||
@@ -277,8 +279,8 @@ They are listed below in order of importance (e.g. most important first):
|
||||
- Variables given while calling a task from another.
|
||||
(See [Calling another task](#calling-another-task) above)
|
||||
- Environment variables
|
||||
- Variables available in the `Taskvars.yml` file
|
||||
- Variables declared locally in the task
|
||||
- Variables available in the `Taskvars.yml` file
|
||||
|
||||
Example of overriding with environment variables:
|
||||
|
||||
@@ -286,14 +288,6 @@ Example of overriding with environment variables:
|
||||
$ TASK_VARIABLE=a-value task do-something
|
||||
```
|
||||
|
||||
Example of `Taskvars.yml` file:
|
||||
|
||||
```yml
|
||||
PROJECT_NAME: My Project
|
||||
DEV_MODE: production
|
||||
GIT_COMMIT: $git log -n 1 --format=%h
|
||||
```
|
||||
|
||||
Example of locally declared vars:
|
||||
|
||||
```yml
|
||||
@@ -304,6 +298,14 @@ print-var:
|
||||
VAR: Hello!
|
||||
```
|
||||
|
||||
Example of `Taskvars.yml` file:
|
||||
|
||||
```yml
|
||||
PROJECT_NAME: My Project
|
||||
DEV_MODE: production
|
||||
GIT_COMMIT: {sh: git log -n 1 --format=%h}
|
||||
```
|
||||
|
||||
> NOTE: It's also possible setting a variable globally using `set` attribute
|
||||
in task, but this is deprecated:
|
||||
|
||||
@@ -321,20 +323,34 @@ set-message:
|
||||
|
||||
#### Dynamic variables
|
||||
|
||||
If you prefix a variable with `$`, then the variable is considered a dynamic
|
||||
variable. The value after the $-symbol will be treated as a command and the
|
||||
output assigned.
|
||||
The below syntax (`sh:` prop in a variable) is considered a dynamic
|
||||
variable. The value will be treated as a command and the output assigned.
|
||||
|
||||
```yml
|
||||
build:
|
||||
cmds:
|
||||
- go build -ldflags="-X main.Version={{.LAST_GIT_COMMIT}}" main.go
|
||||
- go build -ldflags="-X main.Version={{.GIT_COMMIT}}" main.go
|
||||
vars:
|
||||
LAST_GIT_COMMIT: $git log -n 1 --format=%h
|
||||
GIT_COMMIT:
|
||||
sh: git log -n 1 --format=%h
|
||||
```
|
||||
|
||||
This works for all types of variables.
|
||||
|
||||
> It's also possible to prefix the variable with `$` to have a dynamic
|
||||
variable, but this is now considered deprecated:
|
||||
|
||||
```yml
|
||||
# Taskvars.yml
|
||||
|
||||
# recommended
|
||||
GIT_COMMIT:
|
||||
sh: git log -n 1 --format=%h
|
||||
|
||||
# deprecated
|
||||
GIT_COMMIT: $git log -n 1 --format=%h
|
||||
```
|
||||
|
||||
### Go's template engine
|
||||
|
||||
Task parse commands as [Go's template engine][gotemplate] before executing
|
||||
@@ -375,7 +391,8 @@ print-os:
|
||||
|
||||
### Help
|
||||
|
||||
Running `task help` lists all tasks with a description. The following taskfile:
|
||||
Running `task --list` (or `task -l`) lists all tasks with a description.
|
||||
The following taskfile:
|
||||
|
||||
```yml
|
||||
build:
|
||||
@@ -400,8 +417,8 @@ css:
|
||||
would print the following output:
|
||||
|
||||
```bash
|
||||
build Build the go binary.
|
||||
test Run all the go tests.
|
||||
* build: Build the go binary.
|
||||
* test: Run all the go tests.
|
||||
```
|
||||
|
||||
## Watch tasks (experimental)
|
||||
|
||||
@@ -10,6 +10,7 @@ dl-deps:
|
||||
cmds:
|
||||
- go get -u github.com/golang/lint/golint
|
||||
- go get -u github.com/goreleaser/goreleaser
|
||||
- go get -u github.com/asticode/go-astitodo/astitodo
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
|
||||
update-deps:
|
||||
@@ -46,3 +47,8 @@ test-release:
|
||||
desc: Tests release process without publishing
|
||||
cmds:
|
||||
- goreleaser --skip-validate --skip-publish
|
||||
|
||||
todo:
|
||||
desc: Prints TODO comments present in the code
|
||||
cmds:
|
||||
- astitodo {{.GO_PACKAGES}}
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
GIT_COMMIT: $git log -n 1 --format=%h
|
||||
|
||||
GO_PACKAGES:
|
||||
.
|
||||
./cmd/task
|
||||
./execext
|
||||
|
||||
@@ -14,7 +14,7 @@ var (
|
||||
version = "master"
|
||||
)
|
||||
|
||||
const usage = `Usage: task [-ifwv] [--init] [--force] [--watch] [--verbose] [task...]
|
||||
const usage = `Usage: task [-ilfwv] [--init] [--list] [--force] [--watch] [--verbose] [task...]
|
||||
|
||||
Runs the specified task(s). Falls back to the "default" task if no task name
|
||||
was specified, or lists all tasks if an unknown task name was specified.
|
||||
@@ -30,19 +30,22 @@ hello:
|
||||
generates:
|
||||
- output.txt
|
||||
'''
|
||||
|
||||
Options:
|
||||
`
|
||||
|
||||
func main() {
|
||||
log.SetFlags(0)
|
||||
|
||||
pflag.Usage = func() {
|
||||
fmt.Println(usage)
|
||||
fmt.Print(usage)
|
||||
pflag.PrintDefaults()
|
||||
}
|
||||
|
||||
var (
|
||||
versionFlag bool
|
||||
init bool
|
||||
list bool
|
||||
force bool
|
||||
watch bool
|
||||
verbose bool
|
||||
@@ -50,6 +53,7 @@ func main() {
|
||||
|
||||
pflag.BoolVar(&versionFlag, "version", false, "show Task version")
|
||||
pflag.BoolVarP(&init, "init", "i", false, "creates a new Taskfile.yml in the current folder")
|
||||
pflag.BoolVarP(&list, "list", "l", false, "lists tasks with description of current Taskfile")
|
||||
pflag.BoolVarP(&force, "force", "f", false, "forces execution even when the task is up-to-date")
|
||||
pflag.BoolVarP(&watch, "watch", "w", false, "enables watch of the given task")
|
||||
pflag.BoolVarP(&verbose, "verbose", "v", false, "enables verbose mode")
|
||||
@@ -84,6 +88,11 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if list {
|
||||
e.PrintTasksHelp()
|
||||
return
|
||||
}
|
||||
|
||||
args := pflag.Args()
|
||||
if len(args) == 0 {
|
||||
log.Println("task: No argument given, trying default task")
|
||||
|
||||
@@ -66,3 +66,9 @@ func (d *Dep) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
}
|
||||
return ErrCantUnmarshalDep
|
||||
}
|
||||
|
||||
// Call is the parameters to a task call
|
||||
type Call struct {
|
||||
Task string
|
||||
Vars Vars
|
||||
}
|
||||
|
||||
@@ -33,7 +33,10 @@ vars:
|
||||
{
|
||||
yamlTaskCall,
|
||||
&task.Cmd{},
|
||||
&task.Cmd{Task: "another-task", Vars: task.Vars{"PARAM1": "VALUE1", "PARAM2": "VALUE2"}},
|
||||
&task.Cmd{Task: "another-task", Vars: task.Vars{
|
||||
"PARAM1": task.Var{Static: "VALUE1"},
|
||||
"PARAM2": task.Var{Static: "VALUE2"},
|
||||
}},
|
||||
},
|
||||
{
|
||||
yamlDep,
|
||||
@@ -43,7 +46,10 @@ vars:
|
||||
{
|
||||
yamlTaskCall,
|
||||
&task.Dep{},
|
||||
&task.Dep{Task: "another-task", Vars: task.Vars{"PARAM1": "VALUE1", "PARAM2": "VALUE2"}},
|
||||
&task.Dep{Task: "another-task", Vars: task.Vars{
|
||||
"PARAM1": task.Var{Static: "VALUE1"},
|
||||
"PARAM2": task.Var{Static: "VALUE2"},
|
||||
}},
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
|
||||
29
cyclic.go
29
cyclic.go
@@ -1,29 +0,0 @@
|
||||
package task
|
||||
|
||||
// HasCyclicDep checks if a task tree has any cyclic dependency
|
||||
func (e *Executor) HasCyclicDep() bool {
|
||||
visits := make(map[string]struct{}, len(e.Tasks))
|
||||
|
||||
var checkCyclicDep func(string, *Task) bool
|
||||
checkCyclicDep = func(name string, t *Task) bool {
|
||||
if _, ok := visits[name]; ok {
|
||||
return false
|
||||
}
|
||||
visits[name] = struct{}{}
|
||||
defer delete(visits, name)
|
||||
|
||||
for _, d := range t.Deps {
|
||||
if !checkCyclicDep(d.Task, e.Tasks[d.Task]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
for k, v := range e.Tasks {
|
||||
if !checkCyclicDep(k, v) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package task_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/go-task/task"
|
||||
)
|
||||
|
||||
func TestCyclicDepCheck(t *testing.T) {
|
||||
isCyclic := &task.Executor{
|
||||
Tasks: task.Tasks{
|
||||
"task-a": &task.Task{
|
||||
Deps: []*task.Dep{&task.Dep{Task: "task-b"}},
|
||||
},
|
||||
"task-b": &task.Task{
|
||||
Deps: []*task.Dep{&task.Dep{Task: "task-a"}},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if !isCyclic.HasCyclicDep() {
|
||||
t.Error("Task should be cyclic")
|
||||
}
|
||||
|
||||
isNotCyclic := &task.Executor{
|
||||
Tasks: task.Tasks{
|
||||
"task-a": &task.Task{
|
||||
Deps: []*task.Dep{&task.Dep{Task: "task-c"}},
|
||||
},
|
||||
"task-b": &task.Task{
|
||||
Deps: []*task.Dep{&task.Dep{Task: "task-c"}},
|
||||
},
|
||||
"task-c": &task.Task{},
|
||||
},
|
||||
}
|
||||
|
||||
if isNotCyclic.HasCyclicDep() {
|
||||
t.Error("Task should not be cyclic")
|
||||
}
|
||||
}
|
||||
26
errors.go
26
errors.go
@@ -6,8 +6,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// ErrCyclicDependencyDetected is returned when a cyclic dependency was found in the Taskfile
|
||||
ErrCyclicDependencyDetected = errors.New("task: cyclic dependency detected")
|
||||
// ErrTaskfileAlreadyExists is returned on creating a Taskfile if one already exists
|
||||
ErrTaskfileAlreadyExists = errors.New("task: A Taskfile already exists")
|
||||
)
|
||||
@@ -52,3 +50,27 @@ type cantWatchNoSourcesError struct {
|
||||
func (err *cantWatchNoSourcesError) Error() string {
|
||||
return fmt.Sprintf(`task: Can't watch task "%s" because it has no specified sources`, err.taskName)
|
||||
}
|
||||
|
||||
type dynamicVarError struct {
|
||||
cause error
|
||||
cmd string
|
||||
}
|
||||
|
||||
func (err *dynamicVarError) Error() string {
|
||||
return fmt.Sprintf(`task: Command "%s" in taskvars file failed: %s`, err.cmd, err.cause)
|
||||
}
|
||||
|
||||
// MaximumTaskCallExceededError is returned when a task is called too
|
||||
// many times. In this case you probably have a cyclic dependendy or
|
||||
// infinite loop
|
||||
type MaximumTaskCallExceededError struct {
|
||||
task string
|
||||
}
|
||||
|
||||
func (e *MaximumTaskCallExceededError) Error() string {
|
||||
return fmt.Sprintf(
|
||||
`task: maximum task call exceeded (%d) for task "%s": probably an cyclic dep or infinite loop`,
|
||||
MaximumTaskCall,
|
||||
e.task,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -46,8 +46,5 @@ func RunCommand(opts *RunCommandOptions) error {
|
||||
Stdout: opts.Stdout,
|
||||
Stderr: opts.Stderr,
|
||||
}
|
||||
if err = r.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return r.Run()
|
||||
}
|
||||
|
||||
8
file.go
8
file.go
@@ -23,7 +23,9 @@ func maxTime(a, b time.Time) time.Time {
|
||||
|
||||
func getPatternsMinTime(dir string, patterns []string) (m time.Time, err error) {
|
||||
for _, p := range patterns {
|
||||
p = filepath.Join(dir, p)
|
||||
if !filepath.IsAbs(p) {
|
||||
p = filepath.Join(dir, p)
|
||||
}
|
||||
mp, err := getPatternMinTime(p)
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
@@ -34,7 +36,9 @@ func getPatternsMinTime(dir string, patterns []string) (m time.Time, err error)
|
||||
}
|
||||
func getPatternsMaxTime(dir string, patterns []string) (m time.Time, err error) {
|
||||
for _, p := range patterns {
|
||||
p = filepath.Join(dir, p)
|
||||
if !filepath.IsAbs(p) {
|
||||
p = filepath.Join(dir, p)
|
||||
}
|
||||
mp, err := getPatternMaxTime(p)
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
|
||||
5
help.go
5
help.go
@@ -6,7 +6,8 @@ import (
|
||||
"text/tabwriter"
|
||||
)
|
||||
|
||||
func (e *Executor) printExistingTasksHelp() {
|
||||
// PrintTasksHelp prints help os tasks that have a description
|
||||
func (e *Executor) PrintTasksHelp() {
|
||||
tasks := e.tasksWithDesc()
|
||||
if len(tasks) == 0 {
|
||||
return
|
||||
@@ -16,7 +17,7 @@ func (e *Executor) printExistingTasksHelp() {
|
||||
// Format in tab-separated columns with a tab stop of 8.
|
||||
w := tabwriter.NewWriter(e.Stdout, 0, 8, 0, '\t', 0)
|
||||
for _, task := range tasks {
|
||||
fmt.Fprintln(w, fmt.Sprintf("- %s:\t%s", task, e.Tasks[task].Desc))
|
||||
fmt.Fprintln(w, fmt.Sprintf("* %s:\t%s", task, e.Tasks[task].Desc))
|
||||
}
|
||||
w.Flush()
|
||||
}
|
||||
|
||||
173
task.go
173
task.go
@@ -9,6 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/go-task/task/execext"
|
||||
|
||||
@@ -18,6 +19,9 @@ import (
|
||||
const (
|
||||
// TaskFilePath is the default Taskfile
|
||||
TaskFilePath = "Taskfile"
|
||||
// MaximumTaskCall is the max number of times a task can be called.
|
||||
// This exists to prevent infinite loops on cyclic dependencies
|
||||
MaximumTaskCall = 100
|
||||
)
|
||||
|
||||
// Executor executes a Taskfile
|
||||
@@ -35,13 +39,10 @@ type Executor struct {
|
||||
taskvars Vars
|
||||
watchingFiles map[string]struct{}
|
||||
|
||||
dynamicCache Vars
|
||||
dynamicCache map[string]string
|
||||
muDynamicCache sync.Mutex
|
||||
}
|
||||
|
||||
// Vars is a string[string] variables map
|
||||
type Vars map[string]string
|
||||
|
||||
// Tasks representas a group of tasks
|
||||
type Tasks map[string]*Task
|
||||
|
||||
@@ -57,14 +58,12 @@ type Task struct {
|
||||
Vars Vars
|
||||
Set string
|
||||
Env Vars
|
||||
|
||||
callCount int32
|
||||
}
|
||||
|
||||
// Run runs Task
|
||||
func (e *Executor) Run(args ...string) error {
|
||||
if e.HasCyclicDep() {
|
||||
return ErrCyclicDependencyDetected
|
||||
}
|
||||
|
||||
if e.Stdin == nil {
|
||||
e.Stdin = os.Stdin
|
||||
}
|
||||
@@ -76,14 +75,14 @@ func (e *Executor) Run(args ...string) error {
|
||||
}
|
||||
|
||||
if e.dynamicCache == nil {
|
||||
e.dynamicCache = make(Vars, 10)
|
||||
e.dynamicCache = make(map[string]string, 10)
|
||||
}
|
||||
|
||||
// check if given tasks exist
|
||||
for _, a := range args {
|
||||
if _, ok := e.Tasks[a]; !ok {
|
||||
// FIXME: move to the main package
|
||||
e.printExistingTasksHelp()
|
||||
e.PrintTasksHelp()
|
||||
return &taskNotFoundError{taskName: a}
|
||||
}
|
||||
}
|
||||
@@ -96,7 +95,7 @@ func (e *Executor) Run(args ...string) error {
|
||||
}
|
||||
|
||||
for _, a := range args {
|
||||
if err := e.RunTask(context.Background(), a, nil); err != nil {
|
||||
if err := e.RunTask(context.Background(), Call{Task: a, Vars: e.taskvars}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -104,82 +103,93 @@ func (e *Executor) Run(args ...string) error {
|
||||
}
|
||||
|
||||
// RunTask runs a task by its name
|
||||
func (e *Executor) RunTask(ctx context.Context, name string, vars Vars) error {
|
||||
t, ok := e.Tasks[name]
|
||||
func (e *Executor) RunTask(ctx context.Context, call Call) error {
|
||||
t, ok := e.Tasks[call.Task]
|
||||
if !ok {
|
||||
return &taskNotFoundError{name}
|
||||
return &taskNotFoundError{call.Task}
|
||||
}
|
||||
|
||||
if err := e.runDeps(ctx, name, vars); err != nil {
|
||||
if atomic.AddInt32(&t.callCount, 1) >= MaximumTaskCall {
|
||||
return &MaximumTaskCallExceededError{task: call.Task}
|
||||
}
|
||||
|
||||
var err error
|
||||
call.Vars, err = e.getVariables(call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := e.runDeps(ctx, call); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// FIXME: doing again, since a var may have been overriden
|
||||
// using the `set:` attribute of a dependecy.
|
||||
// Remove this when `set` (that is deprecated) be removed
|
||||
call.Vars, err = e.getVariables(call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !e.Force {
|
||||
upToDate, err := e.isTaskUpToDate(ctx, name, vars)
|
||||
upToDate, err := e.isTaskUpToDate(ctx, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if upToDate {
|
||||
e.printfln(`task: Task "%s" is up to date`, name)
|
||||
e.printfln(`task: Task "%s" is up to date`, call.Task)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
for i := range t.Cmds {
|
||||
if err := e.runCommand(ctx, name, i, vars); err != nil {
|
||||
return &taskRunError{name, err}
|
||||
if err := e.runCommand(ctx, call, i); err != nil {
|
||||
return &taskRunError{call.Task, err}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *Executor) runDeps(ctx context.Context, task string, vars Vars) error {
|
||||
func (e *Executor) runDeps(ctx context.Context, call Call) error {
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
t := e.Tasks[task]
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
for _, d := range t.Deps {
|
||||
d := d
|
||||
|
||||
g.Go(func() error {
|
||||
dep, err := e.ReplaceVariables(d.Task, task, vars)
|
||||
c, err := e.toCall(d.Task, d.Vars, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = e.RunTask(ctx, dep, d.Vars); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return e.RunTask(ctx, c)
|
||||
})
|
||||
}
|
||||
|
||||
if err := g.Wait(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return g.Wait()
|
||||
}
|
||||
|
||||
func (e *Executor) isTaskUpToDate(ctx context.Context, task string, vars Vars) (bool, error) {
|
||||
t := e.Tasks[task]
|
||||
func (e *Executor) isTaskUpToDate(ctx context.Context, call Call) (bool, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
if len(t.Status) > 0 {
|
||||
return e.isUpToDateStatus(ctx, task, vars)
|
||||
return e.isUpToDateStatus(ctx, call)
|
||||
}
|
||||
return e.isUpToDateTimestamp(ctx, task, vars)
|
||||
return e.isUpToDateTimestamp(ctx, call)
|
||||
}
|
||||
|
||||
func (e *Executor) isUpToDateStatus(ctx context.Context, task string, vars Vars) (bool, error) {
|
||||
t := e.Tasks[task]
|
||||
func (e *Executor) isUpToDateStatus(ctx context.Context, call Call) (bool, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
environ, err := e.getEnviron(task, vars)
|
||||
environ, err := e.getEnviron(call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
dir, err := e.getTaskDir(task, vars)
|
||||
dir, err := e.getTaskDir(call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
status, err := e.ReplaceSliceVariables(t.Status, task, vars)
|
||||
status, err := e.ReplaceSliceVariables(t.Status, call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -198,23 +208,23 @@ func (e *Executor) isUpToDateStatus(ctx context.Context, task string, vars Vars)
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (e *Executor) isUpToDateTimestamp(ctx context.Context, task string, vars Vars) (bool, error) {
|
||||
t := e.Tasks[task]
|
||||
func (e *Executor) isUpToDateTimestamp(ctx context.Context, call Call) (bool, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
if len(t.Sources) == 0 || len(t.Generates) == 0 {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
dir, err := e.getTaskDir(task, vars)
|
||||
dir, err := e.getTaskDir(call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
sources, err := e.ReplaceSliceVariables(t.Sources, task, vars)
|
||||
sources, err := e.ReplaceSliceVariables(t.Sources, call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
generates, err := e.ReplaceSliceVariables(t.Generates, task, vars)
|
||||
generates, err := e.ReplaceSliceVariables(t.Generates, call)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -228,29 +238,32 @@ func (e *Executor) isUpToDateTimestamp(ctx context.Context, task string, vars Va
|
||||
if err != nil || generatesMinTime.IsZero() {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return generatesMinTime.After(sourcesMaxTime), nil
|
||||
return !generatesMinTime.Before(sourcesMaxTime), nil
|
||||
}
|
||||
|
||||
func (e *Executor) runCommand(ctx context.Context, task string, i int, vars Vars) error {
|
||||
t := e.Tasks[task]
|
||||
func (e *Executor) runCommand(ctx context.Context, call Call, i int) error {
|
||||
t := e.Tasks[call.Task]
|
||||
cmd := t.Cmds[i]
|
||||
|
||||
if cmd.Cmd == "" {
|
||||
return e.RunTask(ctx, cmd.Task, cmd.Vars)
|
||||
c, err := e.toCall(cmd.Task, cmd.Vars, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return e.RunTask(ctx, c)
|
||||
}
|
||||
|
||||
c, err := e.ReplaceVariables(cmd.Cmd, task, vars)
|
||||
c, err := e.ReplaceVariables(cmd.Cmd, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dir, err := e.getTaskDir(task, vars)
|
||||
dir, err := e.getTaskDir(call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
envs, err := e.getEnviron(task, vars)
|
||||
envs, err := e.getEnviron(call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -264,39 +277,53 @@ func (e *Executor) runCommand(ctx context.Context, task string, i int, vars Vars
|
||||
}
|
||||
|
||||
e.println(c)
|
||||
if t.Set == "" {
|
||||
opts.Stdout = e.Stdout
|
||||
if t.Set != "" {
|
||||
var stdout bytes.Buffer
|
||||
opts.Stdout = &stdout
|
||||
if err = execext.RunCommand(opts); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
buff := bytes.NewBuffer(nil)
|
||||
opts.Stdout = buff
|
||||
if err = execext.RunCommand(opts); err != nil {
|
||||
return err
|
||||
}
|
||||
os.Setenv(t.Set, strings.TrimSpace(buff.String()))
|
||||
return os.Setenv(t.Set, strings.TrimSpace(stdout.String()))
|
||||
}
|
||||
return nil
|
||||
|
||||
opts.Stdout = e.Stdout
|
||||
return execext.RunCommand(opts)
|
||||
}
|
||||
|
||||
func (e *Executor) getTaskDir(task string, vars Vars) (string, error) {
|
||||
t := e.Tasks[task]
|
||||
|
||||
exeDir, err := e.ReplaceVariables(e.Dir, task, vars)
|
||||
func (e *Executor) toCall(task string, vs Vars, call Call) (Call, error) {
|
||||
task, err := e.ReplaceVariables(task, call)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return Call{}, err
|
||||
}
|
||||
taskDir, err := e.ReplaceVariables(t.Dir, task, vars)
|
||||
|
||||
newVars := make(Vars, len(vs))
|
||||
for k, v := range vs {
|
||||
static, err := e.ReplaceVariables(v.Static, call)
|
||||
if err != nil {
|
||||
return Call{}, err
|
||||
}
|
||||
sh, err := e.ReplaceVariables(v.Sh, call)
|
||||
if err != nil {
|
||||
return Call{}, err
|
||||
}
|
||||
newVars[k] = Var{Static: static, Sh: sh}
|
||||
}
|
||||
return Call{Task: task, Vars: newVars}, nil
|
||||
}
|
||||
|
||||
func (e *Executor) getTaskDir(call Call) (string, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
taskDir, err := e.ReplaceVariables(t.Dir, call)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return filepath.Join(exeDir, taskDir), nil
|
||||
return filepath.Join(e.Dir, taskDir), nil
|
||||
}
|
||||
|
||||
func (e *Executor) getEnviron(task string, vars Vars) ([]string, error) {
|
||||
t := e.Tasks[task]
|
||||
func (e *Executor) getEnviron(call Call) ([]string, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
if t.Env == nil {
|
||||
return nil, nil
|
||||
@@ -305,7 +332,7 @@ func (e *Executor) getEnviron(task string, vars Vars) ([]string, error) {
|
||||
envs := os.Environ()
|
||||
|
||||
for k, v := range t.Env {
|
||||
env, err := e.ReplaceVariables(fmt.Sprintf("%s=%s", k, v), task, vars)
|
||||
env, err := e.ReplaceVariables(fmt.Sprintf("%s=%s", k, v), call)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
73
task_test.go
73
task_test.go
@@ -2,6 +2,7 @@ package task_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -60,8 +61,10 @@ func TestVars(t *testing.T) {
|
||||
}{
|
||||
{"foo.txt", "foo"},
|
||||
{"bar.txt", "bar"},
|
||||
{"baz.txt", "baz"},
|
||||
{"foo2.txt", "foo2"},
|
||||
{"bar2.txt", "bar2"},
|
||||
{"baz2.txt", "baz2"},
|
||||
{"equal.txt", "foo=bar"},
|
||||
}
|
||||
|
||||
@@ -149,6 +152,61 @@ func TestStatus(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerates(t *testing.T) {
|
||||
var srcTask = "sub/src.txt"
|
||||
var relTask = "rel.txt"
|
||||
var absTask = "abs.txt"
|
||||
|
||||
// This test does not work with a relative dir.
|
||||
dir, err := filepath.Abs("testdata/generates")
|
||||
assert.NoError(t, err)
|
||||
var srcFile = filepath.Join(dir, srcTask)
|
||||
|
||||
for _, task := range []string{srcTask, relTask, absTask} {
|
||||
path := filepath.Join(dir, task)
|
||||
_ = os.Remove(path)
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
t.Errorf("File should not exists: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
buff := bytes.NewBuffer(nil)
|
||||
e := &task.Executor{
|
||||
Dir: dir,
|
||||
Stdout: buff,
|
||||
Stderr: buff,
|
||||
}
|
||||
assert.NoError(t, e.ReadTaskfile())
|
||||
|
||||
for _, task := range []string{relTask, absTask} {
|
||||
var destFile = filepath.Join(dir, task)
|
||||
var upToDate = fmt.Sprintf("task: Task \"%s\" is up to date\n", srcTask) +
|
||||
fmt.Sprintf("task: Task \"%s\" is up to date\n", task)
|
||||
|
||||
// Run task for the first time.
|
||||
assert.NoError(t, e.Run(task))
|
||||
|
||||
if _, err := os.Stat(srcFile); err != nil {
|
||||
t.Errorf("File should exists: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(destFile); err != nil {
|
||||
t.Errorf("File should exists: %v", err)
|
||||
}
|
||||
// Ensure task was not incorrectly found to be up-to-date on first run.
|
||||
if buff.String() == upToDate {
|
||||
t.Errorf("Wrong output message: %s", buff.String())
|
||||
}
|
||||
buff.Reset()
|
||||
|
||||
// Re-run task to ensure it's now found to be up-to-date.
|
||||
assert.NoError(t, e.Run(task))
|
||||
if buff.String() != upToDate {
|
||||
t.Errorf("Wrong output message: %s", buff.String())
|
||||
}
|
||||
buff.Reset()
|
||||
}
|
||||
}
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
const dir = "testdata/init"
|
||||
var file = filepath.Join(dir, "Taskfile.yml")
|
||||
@@ -178,6 +236,9 @@ func TestParams(t *testing.T) {
|
||||
{"exclamation.txt", "!\n"},
|
||||
{"dep1.txt", "Dependence1\n"},
|
||||
{"dep2.txt", "Dependence2\n"},
|
||||
{"spanish.txt", "¡Holla mundo!\n"},
|
||||
{"spanish-dep.txt", "¡Holla dependencia!\n"},
|
||||
{"portuguese.txt", "Olá, mundo!\n"},
|
||||
}
|
||||
|
||||
for _, f := range files {
|
||||
@@ -198,3 +259,15 @@ func TestParams(t *testing.T) {
|
||||
assert.Equal(t, f.content, string(content))
|
||||
}
|
||||
}
|
||||
|
||||
func TestCyclicDep(t *testing.T) {
|
||||
const dir = "testdata/cyclic"
|
||||
|
||||
e := task.Executor{
|
||||
Dir: dir,
|
||||
Stdout: ioutil.Discard,
|
||||
Stderr: ioutil.Discard,
|
||||
}
|
||||
assert.NoError(t, e.ReadTaskfile())
|
||||
assert.IsType(t, &task.MaximumTaskCallExceededError{}, e.Run("task-1"))
|
||||
}
|
||||
|
||||
@@ -31,26 +31,36 @@ func (e *Executor) ReadTaskfile() error {
|
||||
if err := mergo.MapWithOverwrite(&e.Tasks, osTasks); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := e.readTaskvarsFile(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return e.readTaskvars()
|
||||
}
|
||||
|
||||
func (e *Executor) readTaskfileData(path string) (tasks map[string]*Task, err error) {
|
||||
if b, err := ioutil.ReadFile(path + ".yml"); err == nil {
|
||||
return tasks, yaml.Unmarshal(b, &tasks)
|
||||
return tasks, yaml.UnmarshalStrict(b, &tasks)
|
||||
}
|
||||
return nil, taskFileNotFound{path}
|
||||
}
|
||||
|
||||
func (e *Executor) readTaskvarsFile() error {
|
||||
file := filepath.Join(e.Dir, TaskvarsFilePath)
|
||||
func (e *Executor) readTaskvars() error {
|
||||
var (
|
||||
file = filepath.Join(e.Dir, TaskvarsFilePath)
|
||||
osSpecificFile = fmt.Sprintf("%s_%s", file, runtime.GOOS)
|
||||
)
|
||||
|
||||
if b, err := ioutil.ReadFile(file + ".yml"); err == nil {
|
||||
if err := yaml.Unmarshal(b, &e.taskvars); err != nil {
|
||||
if err := yaml.UnmarshalStrict(b, &e.taskvars); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if b, err := ioutil.ReadFile(osSpecificFile + ".yml"); err == nil {
|
||||
osTaskvars := make(Vars, 10)
|
||||
if err := yaml.UnmarshalStrict(b, &osTaskvars); err != nil {
|
||||
return err
|
||||
}
|
||||
for k, v := range osTaskvars {
|
||||
e.taskvars[k] = v
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
7
testdata/cyclic/Taskfile.yml
vendored
Normal file
7
testdata/cyclic/Taskfile.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
task-1:
|
||||
deps:
|
||||
- task: task-2
|
||||
|
||||
task-2:
|
||||
deps:
|
||||
- task: task-1
|
||||
1
testdata/generates/.gitignore
vendored
Normal file
1
testdata/generates/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.txt
|
||||
31
testdata/generates/Taskfile.yml
vendored
Normal file
31
testdata/generates/Taskfile.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
abs.txt:
|
||||
desc: generates dest file based on absolute paths
|
||||
deps:
|
||||
- sub/src.txt
|
||||
dir: sub
|
||||
cmds:
|
||||
- cat src.txt > '{{.BUILD_DIR}}/abs.txt'
|
||||
sources:
|
||||
- src.txt
|
||||
generates:
|
||||
- "{{.BUILD_DIR}}/abs.txt"
|
||||
|
||||
rel.txt:
|
||||
desc: generates dest file based on relative paths
|
||||
deps:
|
||||
- sub/src.txt
|
||||
dir: sub
|
||||
cmds:
|
||||
- cat src.txt > '../rel.txt'
|
||||
sources:
|
||||
- src.txt
|
||||
generates:
|
||||
- "../rel.txt"
|
||||
|
||||
sub/src.txt:
|
||||
desc: generate source file
|
||||
cmds:
|
||||
- mkdir -p sub
|
||||
- echo "hello world" > sub/src.txt
|
||||
status:
|
||||
- test -f sub/src.txt
|
||||
1
testdata/generates/Taskvars.yml
vendored
Normal file
1
testdata/generates/Taskvars.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
BUILD_DIR: $pwd
|
||||
9
testdata/params/Taskfile.yml
vendored
9
testdata/params/Taskfile.yml
vendored
@@ -1,9 +1,14 @@
|
||||
default:
|
||||
vars:
|
||||
SPANISH: ¡Holla mundo!
|
||||
PORTUGUESE: "{{.PORTUGUESE}}"
|
||||
deps:
|
||||
- task: write-file
|
||||
vars: {CONTENT: Dependence1, FILE: dep1.txt}
|
||||
- task: write-file
|
||||
vars: {CONTENT: Dependence2, FILE: dep2.txt}
|
||||
- task: write-file
|
||||
vars: {CONTENT: "{{.SPANISH|replace \"mundo\" \"dependencia\"}}", FILE: spanish-dep.txt}
|
||||
cmds:
|
||||
- task: write-file
|
||||
vars: {CONTENT: Hello, FILE: hello.txt}
|
||||
@@ -11,6 +16,10 @@ default:
|
||||
vars: {CONTENT: "$echo 'World'", FILE: world.txt}
|
||||
- task: write-file
|
||||
vars: {CONTENT: "!", FILE: exclamation.txt}
|
||||
- task: write-file
|
||||
vars: {CONTENT: "{{.SPANISH}}", FILE: spanish.txt}
|
||||
- task: write-file
|
||||
vars: {CONTENT: "{{.PORTUGUESE}}", FILE: portuguese.txt}
|
||||
|
||||
write-file:
|
||||
cmds:
|
||||
|
||||
1
testdata/params/Taskvars.yml
vendored
Normal file
1
testdata/params/Taskvars.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
PORTUGUESE: Olá, mundo!
|
||||
4
testdata/vars/Taskfile.yml
vendored
4
testdata/vars/Taskfile.yml
vendored
@@ -6,12 +6,16 @@ hello:
|
||||
cmds:
|
||||
- echo {{.FOO}} > foo.txt
|
||||
- echo {{.BAR}} > bar.txt
|
||||
- echo {{.BAZ}} > baz.txt
|
||||
- echo {{.FOO2}} > foo2.txt
|
||||
- echo {{.BAR2}} > bar2.txt
|
||||
- echo {{.BAZ2}} > baz2.txt
|
||||
- echo {{.EQUAL}} > equal.txt
|
||||
vars:
|
||||
FOO: foo
|
||||
BAR: $echo bar
|
||||
BAZ:
|
||||
sh: echo baz
|
||||
|
||||
set-equal:
|
||||
set: EQUAL
|
||||
|
||||
2
testdata/vars/Taskvars.yml
vendored
2
testdata/vars/Taskvars.yml
vendored
@@ -1,2 +1,4 @@
|
||||
FOO2: foo2
|
||||
BAR2: $echo bar2
|
||||
BAZ2:
|
||||
sh: echo baz2
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/go-task/task/execext"
|
||||
|
||||
"github.com/Masterminds/sprig"
|
||||
)
|
||||
|
||||
var (
|
||||
// TaskvarsFilePath file containing additional variables
|
||||
TaskvarsFilePath = "Taskvars"
|
||||
// ErrMultilineResultCmd is returned when a command returns multiline result
|
||||
ErrMultilineResultCmd = errors.New("Got multiline result from command")
|
||||
)
|
||||
|
||||
func (e *Executor) handleDynamicVariableContent(value string) (string, error) {
|
||||
if !strings.HasPrefix(value, "$") {
|
||||
return value, nil
|
||||
}
|
||||
|
||||
e.muDynamicCache.Lock()
|
||||
defer e.muDynamicCache.Unlock()
|
||||
if result, ok := e.dynamicCache[value]; ok {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
buff := bytes.NewBuffer(nil)
|
||||
|
||||
opts := &execext.RunCommandOptions{
|
||||
Command: strings.TrimPrefix(value, "$"),
|
||||
Dir: e.Dir,
|
||||
Stdout: buff,
|
||||
Stderr: e.Stderr,
|
||||
}
|
||||
if err := execext.RunCommand(opts); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
result := buff.String()
|
||||
result = strings.TrimSuffix(result, "\n")
|
||||
if strings.ContainsRune(result, '\n') {
|
||||
return "", ErrMultilineResultCmd
|
||||
}
|
||||
|
||||
result = strings.TrimSpace(result)
|
||||
e.verbosePrintfln(`task: dynamic variable: "%s", result: "%s"`, value, result)
|
||||
e.dynamicCache[value] = result
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (e *Executor) getVariables(task string, vars Vars) (map[string]string, error) {
|
||||
t := e.Tasks[task]
|
||||
|
||||
localVariables := make(map[string]string)
|
||||
for key, value := range t.Vars {
|
||||
val, err := e.handleDynamicVariableContent(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
localVariables[key] = val
|
||||
}
|
||||
if e.taskvars != nil {
|
||||
for key, value := range e.taskvars {
|
||||
val, err := e.handleDynamicVariableContent(value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
localVariables[key] = val
|
||||
}
|
||||
}
|
||||
for key, value := range getEnvironmentVariables() {
|
||||
localVariables[key] = value
|
||||
}
|
||||
if vars != nil {
|
||||
for k, v := range vars {
|
||||
val, err := e.handleDynamicVariableContent(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
localVariables[k] = val
|
||||
}
|
||||
}
|
||||
return localVariables, nil
|
||||
}
|
||||
|
||||
var templateFuncs template.FuncMap
|
||||
|
||||
func init() {
|
||||
taskFuncs := template.FuncMap{
|
||||
"OS": func() string { return runtime.GOOS },
|
||||
"ARCH": func() string { return runtime.GOARCH },
|
||||
// historical reasons
|
||||
"IsSH": func() bool { return true },
|
||||
"FromSlash": func(path string) string {
|
||||
return filepath.FromSlash(path)
|
||||
},
|
||||
"ToSlash": func(path string) string {
|
||||
return filepath.ToSlash(path)
|
||||
},
|
||||
"ExeExt": func() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
},
|
||||
}
|
||||
|
||||
templateFuncs = sprig.TxtFuncMap()
|
||||
for k, v := range taskFuncs {
|
||||
templateFuncs[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// ReplaceSliceVariables writes vars into initial string slice
|
||||
func (e *Executor) ReplaceSliceVariables(initials []string, task string, vars Vars) ([]string, error) {
|
||||
result := make([]string, len(initials))
|
||||
for i, s := range initials {
|
||||
var err error
|
||||
result[i], err = e.ReplaceVariables(s, task, vars)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ReplaceVariables writes vars into initial string
|
||||
func (e *Executor) ReplaceVariables(initial, task string, vars Vars) (string, error) {
|
||||
vars, err := e.getVariables(task, vars)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
templ, err := template.New("").Funcs(templateFuncs).Parse(initial)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
b := bytes.NewBuffer(nil)
|
||||
if err = templ.Execute(b, vars); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return b.String(), nil
|
||||
}
|
||||
|
||||
// GetEnvironmentVariables returns environment variables as map
|
||||
func getEnvironmentVariables() map[string]string {
|
||||
var (
|
||||
env = os.Environ()
|
||||
m = make(map[string]string, len(env))
|
||||
)
|
||||
|
||||
for _, e := range env {
|
||||
keyVal := strings.SplitN(e, "=", 2)
|
||||
key, val := keyVal[0], keyVal[1]
|
||||
m[key] = val
|
||||
}
|
||||
return m
|
||||
}
|
||||
219
variables.go
Normal file
219
variables.go
Normal file
@@ -0,0 +1,219 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/go-task/task/execext"
|
||||
|
||||
"github.com/Masterminds/sprig"
|
||||
)
|
||||
|
||||
var (
|
||||
// TaskvarsFilePath file containing additional variables
|
||||
TaskvarsFilePath = "Taskvars"
|
||||
// ErrMultilineResultCmd is returned when a command returns multiline result
|
||||
ErrMultilineResultCmd = errors.New("Got multiline result from command")
|
||||
)
|
||||
|
||||
// Vars is a string[string] variables map
|
||||
type Vars map[string]Var
|
||||
|
||||
// Var represents either a static or dynamic variable
|
||||
type Var struct {
|
||||
Static string
|
||||
Sh string
|
||||
}
|
||||
|
||||
func (vs Vars) toStringMap() (m map[string]string) {
|
||||
m = make(map[string]string, len(vs))
|
||||
for k, v := range vs {
|
||||
m[k] = v.Static
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
// ErrCantUnmarshalVar is returned for invalid var YAML
|
||||
ErrCantUnmarshalVar = errors.New("task: can't unmarshal var value")
|
||||
)
|
||||
|
||||
// UnmarshalYAML implements yaml.Unmarshaler interface
|
||||
func (v *Var) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
var str string
|
||||
if err := unmarshal(&str); err == nil {
|
||||
if strings.HasPrefix(str, "$") {
|
||||
v.Sh = strings.TrimPrefix(str, "$")
|
||||
} else {
|
||||
v.Static = str
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var sh struct {
|
||||
Sh string
|
||||
}
|
||||
if err := unmarshal(&sh); err == nil {
|
||||
v.Sh = sh.Sh
|
||||
return nil
|
||||
}
|
||||
return ErrCantUnmarshalVar
|
||||
}
|
||||
|
||||
var (
|
||||
templateFuncs template.FuncMap
|
||||
)
|
||||
|
||||
func init() {
|
||||
taskFuncs := template.FuncMap{
|
||||
"OS": func() string { return runtime.GOOS },
|
||||
"ARCH": func() string { return runtime.GOARCH },
|
||||
// historical reasons
|
||||
"IsSH": func() bool { return true },
|
||||
"FromSlash": func(path string) string {
|
||||
return filepath.FromSlash(path)
|
||||
},
|
||||
"ToSlash": func(path string) string {
|
||||
return filepath.ToSlash(path)
|
||||
},
|
||||
"ExeExt": func() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return ".exe"
|
||||
}
|
||||
return ""
|
||||
},
|
||||
}
|
||||
|
||||
templateFuncs = sprig.TxtFuncMap()
|
||||
for k, v := range taskFuncs {
|
||||
templateFuncs[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// ReplaceVariables writes vars into initial string
|
||||
func (e *Executor) ReplaceVariables(initial string, call Call) (string, error) {
|
||||
if initial == "" {
|
||||
return initial, nil
|
||||
}
|
||||
|
||||
templ, err := template.New("").Funcs(templateFuncs).Parse(initial)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var b bytes.Buffer
|
||||
if err = templ.Execute(&b, call.Vars.toStringMap()); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return b.String(), nil
|
||||
}
|
||||
|
||||
// ReplaceSliceVariables writes vars into initial string slice
|
||||
func (e *Executor) ReplaceSliceVariables(initials []string, call Call) ([]string, error) {
|
||||
result := make([]string, len(initials))
|
||||
for i, s := range initials {
|
||||
var err error
|
||||
result[i], err = e.ReplaceVariables(s, call)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (e *Executor) getVariables(call Call) (Vars, error) {
|
||||
t := e.Tasks[call.Task]
|
||||
|
||||
result := make(Vars, len(t.Vars)+len(e.taskvars)+len(call.Vars))
|
||||
merge := func(vars Vars, runTemplate bool) error {
|
||||
for k, v := range vars {
|
||||
if runTemplate {
|
||||
var err error
|
||||
v.Static, err = e.ReplaceVariables(v.Static, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
v.Sh, err = e.ReplaceVariables(v.Sh, call)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
v, err := e.handleDynamicVariableContent(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
result[k] = Var{Static: v}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := merge(e.taskvars, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := merge(t.Vars, true); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := merge(getEnvironmentVariables(), false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := merge(call.Vars, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GetEnvironmentVariables returns environment variables as map
|
||||
func getEnvironmentVariables() Vars {
|
||||
var (
|
||||
env = os.Environ()
|
||||
m = make(Vars, len(env))
|
||||
)
|
||||
|
||||
for _, e := range env {
|
||||
keyVal := strings.SplitN(e, "=", 2)
|
||||
key, val := keyVal[0], keyVal[1]
|
||||
m[key] = Var{Static: val}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func (e *Executor) handleDynamicVariableContent(v Var) (string, error) {
|
||||
if v.Static != "" {
|
||||
return v.Static, nil
|
||||
}
|
||||
|
||||
e.muDynamicCache.Lock()
|
||||
defer e.muDynamicCache.Unlock()
|
||||
if result, ok := e.dynamicCache[v.Sh]; ok {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
var stdout bytes.Buffer
|
||||
opts := &execext.RunCommandOptions{
|
||||
Command: v.Sh,
|
||||
Dir: e.Dir,
|
||||
Stdout: &stdout,
|
||||
Stderr: e.Stderr,
|
||||
}
|
||||
if err := execext.RunCommand(opts); err != nil {
|
||||
return "", &dynamicVarError{cause: err, cmd: opts.Command}
|
||||
}
|
||||
|
||||
result := strings.TrimSuffix(stdout.String(), "\n")
|
||||
if strings.ContainsRune(result, '\n') {
|
||||
return "", ErrMultilineResultCmd
|
||||
}
|
||||
|
||||
result = strings.TrimSpace(result)
|
||||
e.verbosePrintfln(`task: dynamic variable: "%s", result: "%s"`, v.Sh, result)
|
||||
e.dynamicCache[v.Sh] = result
|
||||
return result, nil
|
||||
}
|
||||
5
vendor/github.com/Masterminds/semver/CHANGELOG.md
generated
vendored
5
vendor/github.com/Masterminds/semver/CHANGELOG.md
generated
vendored
@@ -1,3 +1,8 @@
|
||||
# 1.3.1 (2017-07-10)
|
||||
|
||||
## Fixed
|
||||
- Fixed #57: number comparisons in prerelease sometimes inaccurate
|
||||
|
||||
# 1.3.0 (2017-05-02)
|
||||
|
||||
## Added
|
||||
|
||||
23
vendor/github.com/Masterminds/semver/version.go
generated
vendored
23
vendor/github.com/Masterminds/semver/version.go
generated
vendored
@@ -394,8 +394,29 @@ func comparePrePart(s, o string) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
if s > o {
|
||||
// When comparing strings "99" is greater than "103". To handle
|
||||
// cases like this we need to detect numbers and compare them.
|
||||
|
||||
oi, n1 := strconv.ParseInt(o, 10, 64)
|
||||
si, n2 := strconv.ParseInt(s, 10, 64)
|
||||
|
||||
// The case where both are strings compare the strings
|
||||
if n1 != nil && n2 != nil {
|
||||
if s > o {
|
||||
return 1
|
||||
}
|
||||
return -1
|
||||
} else if n1 != nil {
|
||||
// o is a string and s is a number
|
||||
return -1
|
||||
} else if n2 != nil {
|
||||
// s is a string and o is a number
|
||||
return 1
|
||||
}
|
||||
// Both are numbers
|
||||
if si > oi {
|
||||
return 1
|
||||
}
|
||||
return -1
|
||||
|
||||
}
|
||||
|
||||
9
vendor/github.com/mvdan/sh/syntax/parser.go
generated
vendored
9
vendor/github.com/mvdan/sh/syntax/parser.go
generated
vendored
@@ -623,6 +623,12 @@ func (p *Parser) wordPart() WordPart {
|
||||
cs.Right = p.matched(cs.Left, leftParen, rightParen)
|
||||
return cs
|
||||
case dollar:
|
||||
r := p.r
|
||||
if r == utf8.RuneSelf || wordBreak(r) || r == '"' || r == '\'' || r == '`' || r == '[' {
|
||||
l := p.lit(p.pos, "$")
|
||||
p.next()
|
||||
return l
|
||||
}
|
||||
p.ensureNoNested()
|
||||
return p.shortParamExp()
|
||||
case cmdIn, cmdOut:
|
||||
@@ -963,9 +969,6 @@ func (p *Parser) shortParamExp() *ParamExp {
|
||||
p.quote = paramName
|
||||
p.advanceLitOther(p.r)
|
||||
p.quote = old
|
||||
if p.val == "" || p.val == "\x80" {
|
||||
p.posErr(pe.Dollar, "$ literal must be escaped or single-quoted")
|
||||
}
|
||||
}
|
||||
pe.Param = p.getLit()
|
||||
return pe
|
||||
|
||||
3
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
3
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
@@ -166,12 +166,14 @@ struct ltchars {
|
||||
#include <linux/fs.h>
|
||||
#include <linux/keyctl.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/seccomp.h>
|
||||
#include <linux/sockios.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/icmpv6.h>
|
||||
#include <linux/serial.h>
|
||||
@@ -404,6 +406,7 @@ ccflags="$@"
|
||||
$2 ~ /^GRND_/ ||
|
||||
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
||||
$2 ~ /^KEYCTL_/ ||
|
||||
$2 ~ /^PERF_EVENT_IOC_/ ||
|
||||
$2 ~ /^SECCOMP_MODE_/ ||
|
||||
$2 ~ /^SPLICE_/ ||
|
||||
$2 ~ /^(VM|VMADDR)_/ ||
|
||||
|
||||
6
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
6
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
@@ -342,10 +342,14 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
|
||||
return
|
||||
}
|
||||
|
||||
func Mkfifo(path string, mode uint32) (err error) {
|
||||
func Mkfifo(path string, mode uint32) error {
|
||||
return Mknod(path, mode|S_IFIFO, 0)
|
||||
}
|
||||
|
||||
func Mkfifoat(dirfd int, path string, mode uint32) error {
|
||||
return Mknodat(dirfd, path, mode|S_IFIFO, 0)
|
||||
}
|
||||
|
||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||
return nil, 0, EINVAL
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_386.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x2401
|
||||
PERF_EVENT_IOC_ENABLE = 0x2400
|
||||
PERF_EVENT_IOC_ID = 0x80042407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x40082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x2402
|
||||
PERF_EVENT_IOC_RESET = 0x2403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x40042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x40042406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1403,6 +1413,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1410,7 +1430,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1430,13 +1452,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1455,11 +1485,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x2401
|
||||
PERF_EVENT_IOC_ENABLE = 0x2400
|
||||
PERF_EVENT_IOC_ID = 0x80082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x40082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x2402
|
||||
PERF_EVENT_IOC_RESET = 0x2403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x40042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x40082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1404,6 +1414,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1411,7 +1431,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1431,13 +1453,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1456,11 +1486,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
generated
vendored
@@ -1055,6 +1055,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x2401
|
||||
PERF_EVENT_IOC_ENABLE = 0x2400
|
||||
PERF_EVENT_IOC_ID = 0x80042407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x40082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x2402
|
||||
PERF_EVENT_IOC_RESET = 0x2403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x40042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x40042406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1408,6 +1418,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1415,7 +1435,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1435,13 +1457,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1460,11 +1490,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x2401
|
||||
PERF_EVENT_IOC_ENABLE = 0x2400
|
||||
PERF_EVENT_IOC_ID = 0x80082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x40082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x2402
|
||||
PERF_EVENT_IOC_RESET = 0x2403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x40042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x40082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1393,6 +1403,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1400,7 +1420,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1420,13 +1442,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1445,11 +1475,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40042407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80042406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1405,6 +1415,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1412,7 +1432,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1432,13 +1454,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1457,11 +1487,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1405,6 +1415,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1412,7 +1432,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1432,13 +1454,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1457,11 +1487,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1405,6 +1415,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1412,7 +1432,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1432,13 +1454,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1457,11 +1487,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
generated
vendored
@@ -1056,6 +1056,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40042407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80042406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1405,6 +1415,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1412,7 +1432,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1432,13 +1454,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1457,11 +1487,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
generated
vendored
@@ -1057,6 +1057,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x2000
|
||||
PENDIN = 0x20000000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1461,6 +1471,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1468,7 +1488,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1488,13 +1510,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x4004667f
|
||||
SIOCOUTQ = 0x40047473
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1513,11 +1543,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
generated
vendored
@@ -1057,6 +1057,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x2000
|
||||
PENDIN = 0x20000000
|
||||
PERF_EVENT_IOC_DISABLE = 0x20002401
|
||||
PERF_EVENT_IOC_ENABLE = 0x20002400
|
||||
PERF_EVENT_IOC_ID = 0x40082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x80082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x20002402
|
||||
PERF_EVENT_IOC_RESET = 0x20002403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x80042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x80082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1461,6 +1471,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1468,7 +1488,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1488,13 +1510,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x4004667f
|
||||
SIOCOUTQ = 0x40047473
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1513,11 +1543,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
34
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
34
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
generated
vendored
@@ -1055,6 +1055,16 @@ const (
|
||||
PARMRK = 0x8
|
||||
PARODD = 0x200
|
||||
PENDIN = 0x4000
|
||||
PERF_EVENT_IOC_DISABLE = 0x2401
|
||||
PERF_EVENT_IOC_ENABLE = 0x2400
|
||||
PERF_EVENT_IOC_ID = 0x80082407
|
||||
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
|
||||
PERF_EVENT_IOC_PERIOD = 0x40082404
|
||||
PERF_EVENT_IOC_REFRESH = 0x2402
|
||||
PERF_EVENT_IOC_RESET = 0x2403
|
||||
PERF_EVENT_IOC_SET_BPF = 0x40042408
|
||||
PERF_EVENT_IOC_SET_FILTER = 0x40082406
|
||||
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
|
||||
PRIO_PGRP = 0x1
|
||||
PRIO_PROCESS = 0x0
|
||||
PRIO_USER = 0x2
|
||||
@@ -1465,6 +1475,16 @@ const (
|
||||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
@@ -1472,7 +1492,9 @@ const (
|
||||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
@@ -1492,13 +1514,21 @@ const (
|
||||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
@@ -1517,11 +1547,15 @@ const (
|
||||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_386.go
generated
vendored
@@ -662,6 +662,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x80045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
generated
vendored
@@ -680,6 +680,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x80045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
generated
vendored
@@ -651,6 +651,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x80045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
generated
vendored
@@ -659,6 +659,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x80045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
generated
vendored
@@ -656,6 +656,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
generated
vendored
@@ -661,6 +661,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
generated
vendored
@@ -661,6 +661,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
generated
vendored
@@ -656,6 +656,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
generated
vendored
@@ -669,6 +669,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
generated
vendored
@@ -669,6 +669,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x40045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
2
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
2
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
generated
vendored
@@ -686,6 +686,8 @@ type Sigset_t struct {
|
||||
|
||||
const RNDGETENTCNT = 0x80045200
|
||||
|
||||
const PERF_IOC_FLAG_GROUP = 0x1
|
||||
|
||||
const _SC_PAGESIZE = 0x1e
|
||||
|
||||
type Termios struct {
|
||||
|
||||
7
vendor/gopkg.in/yaml.v2/decode.go
generated
vendored
7
vendor/gopkg.in/yaml.v2/decode.go
generated
vendored
@@ -190,6 +190,7 @@ type decoder struct {
|
||||
aliases map[string]bool
|
||||
mapType reflect.Type
|
||||
terrors []string
|
||||
strict bool
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -199,8 +200,8 @@ var (
|
||||
ifaceType = defaultMapType.Elem()
|
||||
)
|
||||
|
||||
func newDecoder() *decoder {
|
||||
d := &decoder{mapType: defaultMapType}
|
||||
func newDecoder(strict bool) *decoder {
|
||||
d := &decoder{mapType: defaultMapType, strict: strict}
|
||||
d.aliases = make(map[string]bool)
|
||||
return d
|
||||
}
|
||||
@@ -639,6 +640,8 @@ func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {
|
||||
value := reflect.New(elemType).Elem()
|
||||
d.unmarshal(n.children[i+1], value)
|
||||
inlineMap.SetMapIndex(name, value)
|
||||
} else if d.strict {
|
||||
d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in struct %s", n.line+1, name.String(), out.Type()))
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
8
vendor/gopkg.in/yaml.v2/emitterc.go
generated
vendored
8
vendor/gopkg.in/yaml.v2/emitterc.go
generated
vendored
@@ -994,7 +994,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
|
||||
break_space = false
|
||||
space_break = false
|
||||
|
||||
preceeded_by_whitespace = false
|
||||
preceded_by_whitespace = false
|
||||
followed_by_whitespace = false
|
||||
previous_space = false
|
||||
previous_break = false
|
||||
@@ -1016,7 +1016,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
|
||||
flow_indicators = true
|
||||
}
|
||||
|
||||
preceeded_by_whitespace = true
|
||||
preceded_by_whitespace = true
|
||||
for i, w := 0, 0; i < len(value); i += w {
|
||||
w = width(value[i])
|
||||
followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w)
|
||||
@@ -1047,7 +1047,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
|
||||
block_indicators = true
|
||||
}
|
||||
case '#':
|
||||
if preceeded_by_whitespace {
|
||||
if preceded_by_whitespace {
|
||||
flow_indicators = true
|
||||
block_indicators = true
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool {
|
||||
}
|
||||
|
||||
// [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition.
|
||||
preceeded_by_whitespace = is_blankz(value, i)
|
||||
preceded_by_whitespace = is_blankz(value, i)
|
||||
}
|
||||
|
||||
emitter.scalar_data.multiline = line_breaks
|
||||
|
||||
13
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
13
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
@@ -77,8 +77,19 @@ type Marshaler interface {
|
||||
// supported tag options.
|
||||
//
|
||||
func Unmarshal(in []byte, out interface{}) (err error) {
|
||||
return unmarshal(in, out, false)
|
||||
}
|
||||
|
||||
// UnmarshalStrict is like Unmarshal except that any fields that are found
|
||||
// in the data that do not have corresponding struct members will result in
|
||||
// an error.
|
||||
func UnmarshalStrict(in []byte, out interface{}) (err error) {
|
||||
return unmarshal(in, out, true)
|
||||
}
|
||||
|
||||
func unmarshal(in []byte, out interface{}, strict bool) (err error) {
|
||||
defer handleErr(&err)
|
||||
d := newDecoder()
|
||||
d := newDecoder(strict)
|
||||
p := newParser(in)
|
||||
defer p.destroy()
|
||||
node := p.parse()
|
||||
|
||||
2
vendor/gopkg.in/yaml.v2/yamlh.go
generated
vendored
2
vendor/gopkg.in/yaml.v2/yamlh.go
generated
vendored
@@ -508,7 +508,7 @@ type yaml_parser_t struct {
|
||||
|
||||
problem string // Error description.
|
||||
|
||||
// The byte about which the problem occured.
|
||||
// The byte about which the problem occurred.
|
||||
problem_offset int
|
||||
problem_value int
|
||||
problem_mark yaml_mark_t
|
||||
|
||||
4
watch.go
4
watch.go
@@ -15,7 +15,7 @@ func (e *Executor) watchTasks(args ...string) error {
|
||||
|
||||
// run tasks on init
|
||||
for _, a := range args {
|
||||
if err := e.RunTask(context.Background(), a, nil); err != nil {
|
||||
if err := e.RunTask(context.Background(), Call{Task: a}); err != nil {
|
||||
e.println(err)
|
||||
break
|
||||
}
|
||||
@@ -41,7 +41,7 @@ loop:
|
||||
select {
|
||||
case <-watcher.Events:
|
||||
for _, a := range args {
|
||||
if err := e.RunTask(context.Background(), a, nil); err != nil {
|
||||
if err := e.RunTask(context.Background(), Call{Task: a}); err != nil {
|
||||
e.println(err)
|
||||
continue loop
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user