Skip to content

Commit

Permalink
Remove OS User Group lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
mkungla committed Apr 5, 2017
1 parent ed8466b commit b31e51e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions slackoverflow/application.go
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"os/user"
"path"
"strconv"
"time"

"github.com/aframevr/slackoverflow/slack"
Expand Down Expand Up @@ -38,7 +37,6 @@ type Service struct {
type Application struct {
cwd string
user *user.User
group *user.Group
startTime time.Time
logLevel int
projectPath string
Expand Down Expand Up @@ -207,11 +205,10 @@ func (so *Application) Debugging() bool {

// Start session
func Start() *Application {
gid := os.Getegid()

slackoverflow = &Application{}
slackoverflow.cwd, _ = os.Getwd()
slackoverflow.user, _ = user.Current()
slackoverflow.group, _ = user.LookupGroupId(strconv.Itoa(gid))
slackoverflow.startTime = time.Now()
slackoverflow.projectPath = path.Join(slackoverflow.user.HomeDir, ".slackoverflow")
slackoverflow.configFile = path.Join(slackoverflow.projectPath, "slackoverflow.yaml")
Expand Down
1 change: 0 additions & 1 deletion slackoverflow/cmd-config.go
Expand Up @@ -29,7 +29,6 @@ func (a *cmdConfig) Execute(args []string) error {
si.AddRow("Userame", slackoverflow.user.Username)
si.AddRow("Name", slackoverflow.user.Name)
si.AddRow("User ID", slackoverflow.user.Uid)
si.AddRow("Group", slackoverflow.group.Name)
si.AddRow("Group ID", slackoverflow.user.Gid)
si.Print()

Expand Down

0 comments on commit b31e51e

Please sign in to comment.