Skip to content

Commit

Permalink
Make cmdNameWithContext lower-case to avoid exporting it
Browse files Browse the repository at this point in the history
Signed-off-by: John Blesener <[email protected]>
  • Loading branch information
jblesener committed Mar 27, 2021
1 parent e8b2bea commit 07797b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions process/process_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) {
name := common.IntToString(k.Proc.P_comm[:])

if len(name) >= 15 {
cmdName, err := p.CmdNameWithContext(ctx)
cmdName, err := p.cmdNameWithContext(ctx)
if err != nil {
return "", err
}
Expand All @@ -101,8 +101,8 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) {
return strings.Join(r[0], " "), err
}

// CmdNameWithContext returns the command name (including spaces) without any arguments
func (p *Process) CmdNameWithContext(ctx context.Context) ([]string, error) {
// cmdNameWithContext returns the command name (including spaces) without any arguments
func (p *Process) cmdNameWithContext(ctx context.Context) ([]string, error) {
r, err := callPsWithContext(ctx, "command", p.Pid, false, true)
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions v3/process/process_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (p *Process) NameWithContext(ctx context.Context) (string, error) {
name := common.IntToString(k.Proc.P_comm[:])

if len(name) >= 15 {
cmdName, err := p.CmdNameWithContext(ctx)
cmdName, err := p.cmdNameWithContext(ctx)
if err != nil {
return "", err
}
Expand All @@ -101,8 +101,8 @@ func (p *Process) CmdlineWithContext(ctx context.Context) (string, error) {
return strings.Join(r[0], " "), err
}

// CmdNameWithContext returns the command name (including spaces) without any arguments
func (p *Process) CmdNameWithContext(ctx context.Context) ([]string, error) {
// cmdNameWithContext returns the command name (including spaces) without any arguments
func (p *Process) cmdNameWithContext(ctx context.Context) ([]string, error) {
r, err := callPsWithContext(ctx, "command", p.Pid, false, true)
if err != nil {
return nil, err
Expand Down

0 comments on commit 07797b1

Please sign in to comment.