github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/kbfstool/errors.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"errors"
     9  	"fmt"
    10  )
    11  
    12  var errExactlyOnePath = errors.New("exactly one path must be specified")
    13  var errAtLeastOnePath = errors.New("at least one path must be specified")
    14  
    15  type cannotWriteErr struct {
    16  	pathStr string
    17  	err     error
    18  }
    19  
    20  func (e cannotWriteErr) Error() string {
    21  	if e.err != nil {
    22  		return fmt.Sprintf("cannot write to %s: %v", e.pathStr, e.err)
    23  	}
    24  	return fmt.Sprintf("cannot write to %s", e.pathStr)
    25  }