Merge pull request #2216 from crosbymichael/task-id

Add task.ID() API
This commit is contained in:
Kenfe-Mickaël Laventure 2018-03-19 14:01:54 -07:00 committed by GitHub
commit 4c8bbb55b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -30,6 +30,8 @@ import (
// Process represents a system process // Process represents a system process
type Process interface { type Process interface {
// ID of the process
ID() string
// Pid is the system specific process id // Pid is the system specific process id
Pid() uint32 Pid() uint32
// Start starts the process executing the user's defined binary // Start starts the process executing the user's defined binary

View File

@ -169,6 +169,11 @@ type task struct {
pid uint32 pid uint32
} }
// ID of the task
func (t *task) ID() string {
return t.id
}
// Pid returns the pid or process id for the task // Pid returns the pid or process id for the task
func (t *task) Pid() uint32 { func (t *task) Pid() uint32 {
return t.pid return t.pid