github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/modfetch/codehost/vcs.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package codehost
     6  
     7  import (
     8  	"github.com/shogo82148/std/context"
     9  )
    10  
    11  // A VCSError indicates an error using a version control system.
    12  // The implication of a VCSError is that we know definitively where
    13  // to get the code, but we can't access it due to the error.
    14  // The caller should report this error instead of continuing to probe
    15  // other possible module paths.
    16  //
    17  // TODO(golang.org/issue/31730): See if we can invert this. (Return a
    18  // distinguished error for “repo not found” and treat everything else
    19  // as terminal.)
    20  type VCSError struct {
    21  	Err error
    22  }
    23  
    24  func (e *VCSError) Error() string
    25  
    26  func (e *VCSError) Unwrap() error
    27  
    28  func NewRepo(ctx context.Context, vcs, remote string) (Repo, error)