File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -353,10 +353,6 @@ func repoCreate(cmd *cobra.Command, args []string) error {
353353 return nil
354354}
355355
356- func isURL (arg string ) bool {
357- return strings .HasPrefix (arg , "http:/" ) || strings .HasPrefix (arg , "https:/" )
358- }
359-
360356var Since = func (t time.Time ) time.Duration {
361357 return time .Since (t )
362358}
@@ -390,7 +386,7 @@ func repoFork(cmd *cobra.Command, args []string) error {
390386 } else {
391387 repoArg := args [0 ]
392388
393- if isURL (repoArg ) {
389+ if utils . IsURL (repoArg ) {
394390 parsedURL , err := url .Parse (repoArg )
395391 if err != nil {
396392 return fmt .Errorf ("did not understand argument: %w" , err )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ func viewRun(opts *ViewOptions) error {
7171 return err
7272 }
7373 } else {
74- if isURL (opts .RepoArg ) {
74+ if utils . IsURL (opts .RepoArg ) {
7575 parsedURL , err := url .Parse (opts .RepoArg )
7676 if err != nil {
7777 return fmt .Errorf ("did not understand argument: %w" , err )
@@ -188,10 +188,6 @@ func isMarkdownFile(filename string) bool {
188188}
189189
190190// TODO COPYPASTA FROM command; CONSIDER FOR cmdutil?
191- func isURL (arg string ) bool {
192- return strings .HasPrefix (arg , "http:/" ) || strings .HasPrefix (arg , "https:/" )
193- }
194-
195191func displayURL (urlStr string ) string {
196192 u , err := url .Parse (urlStr )
197193 if err != nil {
Original file line number Diff line number Diff line change @@ -102,3 +102,7 @@ var StopSpinner = func(s *spinner.Spinner) {
102102func Spinner (w io.Writer ) * spinner.Spinner {
103103 return spinner .New (spinner .CharSets [11 ], 400 * time .Millisecond , spinner .WithWriter (w ))
104104}
105+
106+ func IsURL (s string ) bool {
107+ return strings .HasPrefix (s , "http:/" ) || strings .HasPrefix (s , "https:/" )
108+ }
You can’t perform that action at this time.
0 commit comments