refactor: fix module path (#190)

* refactor: fix module path

Change module path from glab to GitHub path in go.mod.
Tidy go.mod
Fix go imports.

Closes 189

* Format code with gofmt

This commit fixes the style issues introduced in 28e5336 according to the output
from gofmt.

Details: https://deepsource.io/gh/profclems/glab/transform/398ecee6-d38c-472d-a91b-21de49624c9f/

* fix: unused imported package

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
Clement Sam 2020-09-02 12:20:33 +00:00 committed by GitHub
parent 3d8c1e4433
commit b8e5b6716e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
67 changed files with 219 additions and 456 deletions

View File

@ -3,8 +3,9 @@ package main
import (
"log"
"github.com/profclems/glab/commands"
"github.com/spf13/cobra/doc"
"glab/commands"
)
func main() {

View File

@ -3,15 +3,16 @@ package main
import (
"errors"
"fmt"
"glab/commands"
"glab/internal/config"
"glab/internal/utils"
"io"
"net"
"os"
"regexp"
"strings"
"github.com/profclems/glab/commands"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/utils"
"github.com/google/shlex"
"github.com/spf13/cobra"
)

View File

@ -11,9 +11,9 @@ import (
"time"
"github.com/pkg/errors"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/utils"
"github.com/spf13/cobra"
"glab/internal/config"
"glab/internal/utils"
)
// Test started when the test binary is started

View File

@ -2,9 +2,10 @@ package commands
import (
"fmt"
"glab/internal/config"
"os"
"github.com/profclems/glab/internal/config"
"github.com/spf13/cobra"
)

View File

@ -2,7 +2,8 @@ package commands
import (
"fmt"
"glab/internal/config"
"github.com/profclems/glab/internal/config"
"github.com/spf13/cobra"
)

View File

@ -1,7 +1,7 @@
package commands
import (
"glab/internal/config"
"github.com/profclems/glab/internal/config"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

View File

@ -4,7 +4,7 @@ import (
"fmt"
"strings"
"glab/internal/utils"
"github.com/profclems/glab/internal/utils"
"github.com/gookit/color"
"github.com/spf13/cobra"

View File

@ -2,11 +2,12 @@ package commands
import (
"fmt"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)
var issueCloseCmd = &cobra.Command{

View File

@ -3,11 +3,12 @@ package commands
import (
"strings"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/config"
"glab/internal/git"
"glab/internal/manip"
)
var issueCreateCmd = &cobra.Command{

View File

@ -2,10 +2,12 @@ package commands
import (
"fmt"
"github.com/spf13/cobra"
"glab/internal/git"
"glab/internal/manip"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
)
var issueDeleteCmd = &cobra.Command{

View File

@ -1,9 +1,10 @@
package commands
import (
"github.com/profclems/glab/internal/git"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var issueListCmd = &cobra.Command{

View File

@ -3,10 +3,12 @@ package commands
import (
"errors"
"fmt"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
gitlab "github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var issueNoteCreateCmd = &cobra.Command{

View File

@ -2,11 +2,13 @@ package commands
import (
"fmt"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)
var issueReopenCmd = &cobra.Command{

View File

@ -2,10 +2,12 @@ package commands
import (
"fmt"
"github.com/spf13/cobra"
"glab/internal/git"
"glab/internal/manip"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
)
var issueSubscribeCmd = &cobra.Command{

View File

@ -2,10 +2,12 @@ package commands
import (
"fmt"
"github.com/spf13/cobra"
"glab/internal/git"
"glab/internal/manip"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
)
var issueUnsubscribeCmd = &cobra.Command{

View File

@ -2,17 +2,19 @@ package commands
import (
"fmt"
"strings"
"time"
"github.com/profclems/glab/internal/browser"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/profclems/glab/internal/utils"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/browser"
"glab/internal/git"
"glab/internal/manip"
"glab/internal/utils"
"strings"
"time"
)
var issueViewCmd = &cobra.Command{

View File

@ -1,10 +1,11 @@
package commands
import (
"github.com/profclems/glab/internal/git"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var labelCreateCmd = &cobra.Command{

View File

@ -2,12 +2,14 @@ package commands
import (
"fmt"
"strings"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/git"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/config"
"glab/internal/git"
"strings"
)
var labelListCmd = &cobra.Command{

View File

@ -2,7 +2,8 @@ package commands
import (
"fmt"
"glab/internal/utils"
"github.com/profclems/glab/internal/utils"
"github.com/gookit/color"
"github.com/spf13/cobra"

View File

@ -4,11 +4,12 @@ import (
"fmt"
"strings"
"github.com/logrusorgru/aurora"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var mrApproveCmd = &cobra.Command{
@ -31,7 +32,7 @@ func approveMergeRequest(cmd *cobra.Command, args []string) {
// ToDo:
//}
fmt.Println(aurora.Yellow("Approving Merge Request #" + mergeID + "..."))
fmt.Println(color.Yellow.Sprint("Approving Merge Request #" + mergeID + "..."))
gitlabClient, repo := git.InitGitlabClient()
if r, _ := cmd.Flags().GetString("repo"); r != "" {
repo = r
@ -39,7 +40,7 @@ func approveMergeRequest(cmd *cobra.Command, args []string) {
_, resp, _ := gitlabClient.MergeRequestApprovals.ApproveMergeRequest(repo, manip.StringToInt(mergeID), l)
if resp != nil {
if resp.StatusCode == 201 {
fmt.Println(aurora.Green("Merge Request approved successfully"))
fmt.Println(color.Green.Sprint("Merge Request approved successfully"))
} else if resp.StatusCode == 405 {
fmt.Println("Merge request cannot be approved")
} else if resp.StatusCode == 401 {

View File

@ -4,8 +4,8 @@ import (
"fmt"
"strings"
"glab/internal/git"
"glab/internal/manip"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/gookit/color"
"github.com/gosuri/uitable"

View File

@ -4,12 +4,13 @@ import (
"fmt"
"log"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/tcnksm/go-gitconfig"
"github.com/xanzy/go-gitlab"
"glab/internal/config"
"glab/internal/git"
"glab/internal/manip"
)
type mrCheckoutConfig struct {

View File

@ -2,12 +2,14 @@ package commands
import (
"fmt"
"github.com/logrusorgru/aurora"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)
var mrCloseCmd = &cobra.Command{
@ -32,10 +34,10 @@ func closeMergeRequestState(cmd *cobra.Command, args []string) {
fmt.Println("Closing Merge request...")
mr, resp, _ := gitlabClient.MergeRequests.UpdateMergeRequest(repo, manip.StringToInt(i2), l)
if resp.StatusCode == 200 {
fmt.Println(aurora.Green("You have closed merge request #" + i2))
fmt.Println(color.Green.Sprint("You have closed merge request #" + i2))
displayMergeRequest(mr)
} else if resp.StatusCode == 404 {
fmt.Println(aurora.Red("MergeRequest does not exist"))
fmt.Println(color.Red.Sprint("MergeRequest does not exist"))
} else {
fmt.Println("Could not complete request: ", resp.Status)
}

View File

@ -2,10 +2,12 @@ package commands
import (
"fmt"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)

View File

@ -4,10 +4,11 @@ import (
"fmt"
"strings"
"github.com/logrusorgru/aurora"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
"glab/internal/git"
"glab/internal/manip"
)
var mrDeleteCmd = &cobra.Command{
@ -35,13 +36,13 @@ func deleteMergeRequest(cmd *cobra.Command, args []string) error {
if issue != nil {
if issue.StatusCode == 204 {
fmt.Println(aurora.Green("Merge Request Deleted Successfully"))
fmt.Println(color.Green.Sprint("Merge Request Deleted Successfully"))
} else if issue.StatusCode == 404 {
fmt.Println(aurora.Red("Merge Request does not exist"))
fmt.Println(color.Red.Sprint("Merge Request does not exist"))
} else if issue.StatusCode == 401 {
fmt.Println(aurora.Red("You are not authorized to perform this action"))
fmt.Println(color.Red.Sprint("You are not authorized to perform this action"))
} else {
fmt.Println(aurora.Red("Could not complete request."))
fmt.Println(color.Red.Sprint("Could not complete request."))
}
} else if err != nil {
return err

View File

@ -4,11 +4,12 @@ import (
"fmt"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var mrForCmd = &cobra.Command{

View File

@ -4,9 +4,10 @@ import (
"github.com/spf13/cobra"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var mrIssuesCmd = &cobra.Command{

View File

@ -1,9 +1,10 @@
package commands
import (
"github.com/profclems/glab/internal/git"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var mrListCmd = &cobra.Command{

View File

@ -8,8 +8,8 @@ import (
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
)
var mrMergeCmd = &cobra.Command{

View File

@ -2,8 +2,8 @@ package commands
import (
"fmt"
"glab/internal/git"
"glab/internal/manip"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"log"
"github.com/spf13/cobra"

View File

@ -5,10 +5,11 @@ import (
"log"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var mrRebaseCmd = &cobra.Command{

View File

@ -2,12 +2,14 @@ package commands
import (
"fmt"
"github.com/logrusorgru/aurora"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)
var mrReopenCmd = &cobra.Command{
@ -33,7 +35,7 @@ func reopenMergeRequestState(cmd *cobra.Command, args []string) {
fmt.Printf("Updating Merge request #%s...\n", i2)
mr, resp, _ := gitlabClient.MergeRequests.UpdateMergeRequest(repo, manip.StringToInt(i2), l)
if resp.StatusCode == 200 {
fmt.Println(aurora.Green("You have reopened merge request #" + i2))
fmt.Println(color.Green.Sprint("You have reopened merge request #" + i2))
displayMergeRequest(mr)
} else if resp.StatusCode == 404 {
er("MergeRequest does not exist")

View File

@ -2,13 +2,13 @@ package commands
import (
"fmt"
"github.com/spf13/cobra"
"github.com/gookit/color"
"strings"
"github.com/logrusorgru/aurora"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"glab/internal/git"
"glab/internal/manip"
"github.com/spf13/cobra"
)
var mrRevokeCmd = &cobra.Command{
@ -24,7 +24,7 @@ func revokeMergeRequest(cmd *cobra.Command, args []string) {
if len(args) > 0 {
mergeID := strings.Trim(args[0], " ")
fmt.Println(aurora.Yellow("Revoking approval for Merge Request #" + mergeID + "..."))
fmt.Println(color.Yellow.Sprint("Revoking approval for Merge Request #" + mergeID + "..."))
gitlabClient, repo := git.InitGitlabClient()
if r, _ := cmd.Flags().GetString("repo"); r != "" {
repo = r
@ -32,7 +32,7 @@ func revokeMergeRequest(cmd *cobra.Command, args []string) {
resp, _ := gitlabClient.MergeRequestApprovals.UnapproveMergeRequest(repo, manip.StringToInt(mergeID))
if resp != nil {
if resp.StatusCode == 201 {
fmt.Println(aurora.Green("Merge Request approval revoked successfully"))
fmt.Println(color.Green.Sprint("Merge Request approval revoked successfully"))
} else if resp.StatusCode == 405 {
er("Merge request cannot be unapproved")
} else if resp.StatusCode == 401 {

View File

@ -4,11 +4,11 @@ import (
"fmt"
"strings"
"github.com/logrusorgru/aurora"
"github.com/spf13/cobra"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"glab/internal/git"
"glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
)
var mrSubscribeCmd = &cobra.Command{
@ -35,7 +35,7 @@ func subscribeSubscribeRequest(cmd *cobra.Command, args []string) {
if resp.StatusCode == 204 {
bodyString := resp.Body
fmt.Println(bodyString)
fmt.Println(aurora.Green("You have successfully subscribed to merge request #" + i2))
fmt.Println(color.Green.Sprint("You have successfully subscribed to merge request #" + i2))
displayMergeRequest(issue)
} else if resp.StatusCode == 404 {
er("Merge Request does not exist")

View File

@ -2,8 +2,9 @@ package commands
import (
"fmt"
"glab/internal/git"
"glab/internal/manip"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/spf13/cobra"
)

View File

@ -4,11 +4,11 @@ import (
"fmt"
"strings"
"github.com/logrusorgru/aurora"
"github.com/spf13/cobra"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"glab/internal/git"
"glab/internal/manip"
"github.com/gookit/color"
"github.com/spf13/cobra"
)
var mrUnsubscribeCmd = &cobra.Command{
@ -35,7 +35,7 @@ func unsubscribeMergeRequest(cmd *cobra.Command, args []string) {
if resp.StatusCode == 204 {
bodyString := resp.Body
fmt.Println(bodyString)
fmt.Println(aurora.Green("You have successfully unsubscribed to merge request #" + i2))
fmt.Println(color.Green.Sprint("You have successfully unsubscribed to merge request #" + i2))
displayMergeRequest(mr)
} else if resp.StatusCode == 404 {
er("MergeRequest does not exist")

View File

@ -1,12 +1,14 @@
package commands
import (
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"strings"
)
var mrUpdateCmd = &cobra.Command{

View File

@ -2,18 +2,20 @@ package commands
import (
"fmt"
"log"
"strings"
"time"
"github.com/profclems/glab/internal/browser"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/profclems/glab/internal/utils"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/browser"
"glab/internal/git"
"glab/internal/manip"
"glab/internal/utils"
"log"
"strings"
"time"
)
var mrViewCmd = &cobra.Command{

View File

@ -3,16 +3,17 @@ package commands
import (
"errors"
"fmt"
"glab/internal/utils"
"io"
"math"
"os"
"text/tabwriter"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/utils"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
func displayMultiplePipelines(m []*gitlab.PipelineInfo) {

View File

@ -2,12 +2,12 @@ package commands
import (
"fmt"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"io/ioutil"
"log"
"os"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/spf13/cobra"
)

View File

@ -11,13 +11,14 @@ import (
"sync"
"time"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/AlecAivazis/survey/v2"
"github.com/MakeNowJust/heredoc"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
)
var (

View File

@ -4,9 +4,6 @@ import (
"bufio"
"context"
"fmt"
"github.com/MakeNowJust/heredoc"
"glab/internal/git"
"glab/internal/utils"
"io"
"log"
"os"
@ -14,6 +11,10 @@ import (
"strings"
"time"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/utils"
"github.com/MakeNowJust/heredoc"
"github.com/gdamore/tcell"
"github.com/pkg/errors"
"github.com/rivo/tview"

View File

@ -2,11 +2,12 @@ package commands
import (
"fmt"
"glab/internal/git"
"glab/internal/manip"
"strconv"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/manip"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/spf13/cobra"

View File

@ -1,10 +1,11 @@
package commands
import (
"github.com/profclems/glab/internal/git"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var pipelineListCmd = &cobra.Command{

View File

@ -4,13 +4,14 @@ import (
"fmt"
"time"
"github.com/profclems/glab/internal/git"
"github.com/AlecAivazis/survey/v2"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/gosuri/uilive"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var pipelineStatusCmd = &cobra.Command{

View File

@ -1,265 +0,0 @@
package commands
/*
import (
"fmt"
"io"
"io/ioutil"
"log"
"strings"
"github.com/MakeNowJust/heredoc"
"github.com/jroimartin/gocui"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/manip"
"glab/internal/utils"
)
var pipelineViewCmd = &cobra.Command{
Use: "view <pipeline-id> [flags]",
Short: `View a single pipeline`,
Example: heredoc.Doc(`
$ glab pipeline view 177883
`),
Long: ``,
Args: cobra.ExactArgs(1),
Run: viewPipelines,
}
var pipelineDetails *gitlab.Pipeline
var pipelineJobDetails []*gitlab.Job
var mainView *gocui.View
func viewPipelines(cmd *cobra.Command, args []string) {
if len(args) > 1 || len(args) == 0 {
cmdErr(cmd, args)
return
}
pid := manip.StringToInt(args[0])
gitlabClient, repo := git.InitGitlabClient()
fmt.Println("Finding pipeline...", pid)
pipes, _, err := gitlabClient.Pipelines.GetPipeline(repo, pid)
pipelineDetails = pipes
if err != nil {
er(err)
}
fmt.Println("Getting Pipeline Job...")
pipelineJobDetails = getPipelineJobs(pid)
fmt.Println("Setting up view...")
g, err := gocui.NewGui(gocui.OutputNormal)
if err != nil {
log.Panicln(err)
}
defer g.Close()
g.Cursor = true
g.InputEsc = true
g.SetManagerFunc(layout)
if err := keybindings(g); err != nil {
log.Panicln(err)
}
if err := g.MainLoop(); err != nil && err != gocui.ErrQuit {
log.Panicln(err)
}
}
func nextView(g *gocui.Gui, v *gocui.View) error {
if v == nil || v.Name() == "side" {
_, err := g.SetCurrentView("main")
return err
}
_, err := g.SetCurrentView("side")
return err
}
func cursorDown(g *gocui.Gui, v *gocui.View) error {
if v != nil {
cx, cy := v.Cursor()
if err := v.SetCursor(cx, cy+1); err != nil {
ox, oy := v.Origin()
if err := v.SetOrigin(ox, oy+1); err != nil {
return err
}
}
}
return nil
}
func cursorUp(g *gocui.Gui, v *gocui.View) error {
if v != nil {
ox, oy := v.Origin()
cx, cy := v.Cursor()
if err := v.SetCursor(cx, cy-1); err != nil && oy > 0 {
if err := v.SetOrigin(ox, oy-1); err != nil {
return err
}
}
}
return nil
}
func showLoading(g *gocui.Gui, v *gocui.View) error {
var l string
var err error
_, cy := v.Cursor()
if l, err = v.Line(cy); err != nil {
l = ""
}
maxX, maxY := g.Size()
if v, err := g.SetView("msg", maxX/2-30, maxY/2, maxX/2+30, maxY/2+2); err != nil {
if err != gocui.ErrUnknownView {
return err
}
fmt.Fprintln(v, "Loading job log for", l)
if _, err := g.SetCurrentView("msg"); err != nil {
return err
}
}
updatePipelineLog(mainView, 670715799)
return nil
}
func delMsg(g *gocui.Gui, v *gocui.View) error {
if err := g.DeleteView("msg"); err != nil {
return err
}
if _, err := g.SetCurrentView("side"); err != nil {
return err
}
return nil
}
func quit(g *gocui.Gui, v *gocui.View) error {
return gocui.ErrQuit
}
func keybindings(g *gocui.Gui) error {
if err := g.SetKeybinding("side", gocui.KeyCtrlSpace, gocui.ModNone, nextView); err != nil {
return err
}
if err := g.SetKeybinding("main", gocui.KeyCtrlSpace, gocui.ModNone, nextView); err != nil {
return err
}
if err := g.SetKeybinding("side", gocui.KeyArrowDown, gocui.ModNone, cursorDown); err != nil {
return err
}
if err := g.SetKeybinding("side", gocui.KeyArrowUp, gocui.ModNone, cursorUp); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyCtrlQ, gocui.ModNone, quit); err != nil {
return err
}
if err := g.SetKeybinding("side", gocui.KeyEnter, gocui.ModNone, showLoading); err != nil {
return err
}
if err := g.SetKeybinding("msg", gocui.KeyEnter, gocui.ModNone, delMsg); err != nil {
return err
}
if err := g.SetKeybinding("main", gocui.KeyCtrlS, gocui.ModNone, saveMain); err != nil {
return err
}
if err := g.SetKeybinding("main", gocui.KeyCtrlW, gocui.ModNone, saveVisualMain); err != nil {
return err
}
return nil
}
func saveMain(g *gocui.Gui, v *gocui.View) error {
f, err := ioutil.TempFile("", "gocui_demo_")
if err != nil {
return err
}
defer f.Close()
p := make([]byte, 5)
v.Rewind()
for {
n, err := v.Read(p)
if n > 0 {
if _, err := f.Write(p[:n]); err != nil {
return err
}
}
if err == io.EOF {
break
}
if err != nil {
return err
}
}
return nil
}
func saveVisualMain(g *gocui.Gui, v *gocui.View) error {
f, err := ioutil.TempFile("", "gocui_demo_")
if err != nil {
return err
}
defer f.Close()
vb := v.ViewBuffer()
if _, err := io.Copy(f, strings.NewReader(vb)); err != nil {
return err
}
return nil
}
func layout(g *gocui.Gui) error {
maxX, maxY := g.Size()
var firstJobID int
if v, err := g.SetView("side", -1, -1, 30, maxY); err != nil {
if err != gocui.ErrUnknownView {
return err
}
v.Highlight = true
v.SelBgColor = gocui.ColorGreen
v.SelFgColor = gocui.ColorBlack
for i, pipelineJob := range pipelineJobDetails {
if i == 0 {
firstJobID = pipelineJob.ID
}
fmt.Fprintf(v, "%s (%s)\n", pipelineJob.Name, pipelineJob.Status)
}
}
return displayPipelineJobLog(g, firstJobID, maxX, maxY)
}
func displayPipelineJobLog(g *gocui.Gui, jid int, maxX, maxY int) error {
if v, err := g.SetView("main", 30, -1, maxX, maxY); err != nil {
if err != gocui.ErrUnknownView {
return err
}
updatePipelineLog(v, jid)
v.Editable = true
v.Wrap = true
v.Autoscroll = true
v.Overwrite = true
if _, err := g.SetCurrentView("side"); err != nil {
return err
}
mainView = v
}
return nil
}
func updatePipelineLog(v *gocui.View, jid int) {
var str string
if b, err := ioutil.ReadAll(getPipelineJobLog(jid)); err == nil {
str = string(b)
}
str, _ = utils.RenderMarkdown(str)
fmt.Fprintln(v, str)
//updatePipelineLog(v, jid)
}
func init() {
pipelineCmd.AddCommand(pipelineViewCmd)
}
*/

View File

@ -1,7 +1,7 @@
package commands
import (
"glab/internal/git"
"github.com/profclems/glab/internal/git"
"github.com/xanzy/go-gitlab"
)

View File

@ -2,12 +2,14 @@ package commands
import (
"fmt"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/utils"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
"glab/internal/utils"
"strings"
)
var projectSearchCmd = &cobra.Command{

View File

@ -2,7 +2,7 @@ package commands
import (
"fmt"
"glab/internal/utils"
"github.com/profclems/glab/internal/utils"
"github.com/gookit/color"
"github.com/spf13/cobra"

View File

@ -1,7 +1,7 @@
package commands
import (
"glab/internal/git"
"github.com/profclems/glab/internal/git"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"

View File

@ -3,15 +3,17 @@ package commands
import (
"bytes"
"fmt"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/config"
"glab/internal/git"
"io"
"log"
"os"
"strings"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/git"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
)
var repoArchiveCmd = &cobra.Command{

View File

@ -5,10 +5,11 @@ import (
"strconv"
"strings"
"github.com/profclems/glab/internal/git"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var repoCloneCmd = &cobra.Command{

View File

@ -2,11 +2,13 @@ package commands
import (
"fmt"
"github.com/profclems/glab/internal/git"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
var repoContributorsCmd = &cobra.Command{

View File

@ -2,16 +2,17 @@ package commands
import (
"fmt"
"github.com/hashicorp/go-version"
"glab/internal/config"
"glab/internal/git"
"glab/internal/update"
"os"
"strings"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/git"
"github.com/profclems/glab/internal/update"
"github.com/MakeNowJust/heredoc"
"github.com/gookit/color"
"github.com/gosuri/uitable"
"github.com/hashicorp/go-version"
"github.com/spf13/cobra"
)

View File

@ -3,8 +3,9 @@ package commands
import (
"log"
"github.com/profclems/glab/internal/git"
"github.com/xanzy/go-gitlab"
"glab/internal/git"
)
func currentUser() (string, error) {

View File

@ -3,8 +3,9 @@ package commands
import (
"fmt"
"github.com/profclems/glab/internal/git"
"github.com/spf13/cobra"
"glab/internal/git"
)
// Version is the version for glab

View File

@ -3,10 +3,11 @@ package commands
import (
"bytes"
"fmt"
"github.com/stretchr/testify/assert"
"io"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Version(t *testing.T) {

6
go.mod
View File

@ -1,4 +1,4 @@
module glab
module github.com/profclems/glab
go 1.13
@ -24,19 +24,15 @@ require (
github.com/otiai10/copy v1.2.0
github.com/pkg/errors v0.9.1
github.com/rivo/tview v0.0.0-20200712113419-c65badfc3d92
github.com/smartystreets/goconvey v1.6.4
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.4.0
github.com/tcnksm/go-gitconfig v0.1.2
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect
github.com/xanzy/go-gitlab v0.37.0
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20200808120158-1030fc2bf1d9 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200828161849-5deb26317202 // indirect
google.golang.org/appengine v1.6.1 // indirect
)

30
go.sum
View File

@ -89,14 +89,8 @@ github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f h1:5CjVwnuUcp5adK4gm
github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/gookit/color v1.2.7 h1:4qePMNWZhrmbfYJDix+J4V2l0iVW+6jQGjicELlN14E=
github.com/gookit/color v1.2.7/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gookit/color v1.2.8 h1:9wExr3qoZN7h81JecfXkynnlAWLPlvDmVMqLw9Sr6Cw=
github.com/gookit/color v1.2.8/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gookit/color v1.2.9 h1:1gwRqF/u6wZrxzn+thlROF7D4Toi9eVGUidZNAxAZHE=
github.com/gookit/color v1.2.9/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gosuri/uilive v0.0.4 h1:hUEBpQDj8D8jXgtCdBu7sWsy5sbW/5GhuO8KBwJ2jyY=
github.com/gosuri/uilive v0.0.4/go.mod h1:V/epo5LjjlDE5RJUcqx8dbw+zc93y5Ya3yg8tfZ74VI=
@ -121,8 +115,6 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
@ -205,7 +197,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/profclems/glab v1.10.0 h1:C3qiKHQDtZbt/+PigvNZRy75/JKMQc9VXunyAni8kR0=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
@ -227,10 +218,6 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
@ -258,15 +245,10 @@ github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPg
github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0=
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM=
github.com/xanzy/go-gitlab v0.36.0 h1:YSYC7Kh31bPtfJwMCa+cxoSymw2EJxvgXNi1B3IvwE8=
github.com/xanzy/go-gitlab v0.36.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xanzy/go-gitlab v0.37.0 h1:Z/CQkjj5VwbWVYVL7S70kS/TFj5H/pJumV7xbJ0YUQ8=
github.com/xanzy/go-gitlab v0.37.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.0 h1:WOOcyaJPlzb8fZ8TloxFe8QZkhOOJx87leDa9MIT9dc=
github.com/yuin/goldmark v1.2.0/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
@ -278,14 +260,12 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -298,7 +278,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
@ -313,7 +292,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTm
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -349,16 +327,8 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b h1:mSUCVIwDx4hfXJfWsOPfdzEHxzb2Xjl6BQ8YgPnazQA=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200828153748-6c983e6784ec h1:EG9sX2DjBtkBZXj4HUyMwE2ZlYQckvO2vXFJ3RImlBI=
golang.org/x/tools v0.0.0-20200828153748-6c983e6784ec/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200828161849-5deb26317202 h1:DrWbY9UUFi/sl/3HkNVoBjDbGfIPZZfgoGsGxOL1EU8=
golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=

View File

@ -7,7 +7,7 @@ import (
"strings"
"github.com/google/shlex"
"glab/internal/config"
"github.com/profclems/glab/internal/config"
)
// Command produces an exec.Cmd respecting runtime.GOOS and $BROWSER environment variable

View File

@ -4,13 +4,14 @@ import (
"bufio"
"errors"
"fmt"
"glab/internal/manip"
"io/ioutil"
"log"
"os"
"os/user"
"strings"
"github.com/profclems/glab/internal/manip"
"github.com/logrusorgru/aurora"
"github.com/spf13/cobra"
"github.com/tcnksm/go-gitconfig"

View File

@ -13,10 +13,10 @@ import (
"regexp"
"strings"
"github.com/profclems/glab/internal/config"
"github.com/profclems/glab/internal/run"
"github.com/tcnksm/go-gitconfig"
"github.com/xanzy/go-gitlab"
"glab/internal/config"
"glab/internal/run"
)
// GetRepo returns the repo name of the git directory with the namespace like profclems/glab

View File

@ -6,8 +6,8 @@ import (
"reflect"
"testing"
"glab/internal/run"
"glab/test"
"github.com/profclems/glab/internal/run"
"github.com/profclems/glab/test"
)
func Test_isFilesystemPath(t *testing.T) {

View File

@ -2,7 +2,6 @@ package manip
import (
"fmt"
"github.com/AlecAivazis/survey/v2"
"log"
"math"
"regexp"
@ -10,6 +9,8 @@ import (
"strings"
"time"
"unicode/utf8"
"github.com/AlecAivazis/survey/v2"
)
/*

View File

@ -2,8 +2,9 @@ package update
import (
"encoding/json"
"glab/internal/request"
"time"
"github.com/profclems/glab/internal/request"
)
type ReleaseInfo struct {

View File

@ -2,15 +2,16 @@ package utils
import (
"fmt"
"glab/internal/config"
"net/url"
"strings"
"time"
"github.com/profclems/glab/internal/config"
"github.com/charmbracelet/glamour"
"github.com/gookit/color"
"glab/internal/browser"
"glab/internal/run"
"github.com/profclems/glab/internal/browser"
"github.com/profclems/glab/internal/run"
)
// OpenInBrowser opens the url in a web browser based on OS and $BROWSER environment variable

View File

@ -7,7 +7,7 @@ import (
"regexp"
"github.com/pkg/errors"
"glab/internal/run"
"github.com/profclems/glab/internal/run"
)
// TODO copypasta from command package