Skip to content

Commit

Permalink
examples: helpers: pac: fix error check
Browse files Browse the repository at this point in the history
  • Loading branch information
oiweiwei committed Oct 16, 2024
1 parent 3185ef1 commit 1c9cf71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/helpers/pac.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"io"
"log"
"os"
"strings"

"github.com/oiweiwei/go-msrpc/msrpc/pac"
)
Expand All @@ -33,7 +34,7 @@ func main() {
)

if f = os.Stdin; input != "-" && input != "" {
if _, err := os.Stat(input); !os.IsNotExist(err) {
if _, err := os.Stat(input); err != nil && (os.IsNotExist(err) || strings.Contains(err.Error(), "too long")) {
f = bytes.NewReader([]byte(input))
} else if f, err = os.Open(input); err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 1c9cf71

Please sign in to comment.