Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Update uuid #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd_plus.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ func (c *CmdPlus) GetOutput() string {
// It will immediately send an OutputChunk with an empty chunk and the full output
// thus far. It also returns a function that when called closes the channel
func (c *CmdPlus) GetOutputChannel() (chan OutputChunk, func()) {
id := uuid.NewV4().String()
idv4, err := uuid.NewV4()
if err != nil {
fmt.Printf("cannot create new UUID: %v", err)
os.Exit(1)
}
id := idv4.String()
c.mutex.Lock()
defer c.mutex.Unlock()
c.outputChannels[id] = make(chan OutputChunk)
Expand Down