Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: client/internal/common/utils.go

Issue 2941963002: Remove batcharchive dependency on common.IsDirectory (Closed)
Patch Set: Remove unused import Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/cmd/isolate/batch_archive.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package common 5 package common
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 "os" 9 "os"
10 "runtime" 10 "runtime"
11 11
12 "github.com/luci/luci-go/common/system/terminal" 12 "github.com/luci/luci-go/common/system/terminal"
13 ) 13 )
14 14
15 // IsDirectory returns true if path is a directory and is accessible.
16 func IsDirectory(path string) bool {
17 fileInfo, err := os.Stat(path)
18 return err == nil && fileInfo.IsDir()
19 }
20
21 // IsWindows returns True when running on the best OS there is. 15 // IsWindows returns True when running on the best OS there is.
22 func IsWindows() bool { 16 func IsWindows() bool {
23 return runtime.GOOS == "windows" 17 return runtime.GOOS == "windows"
24 } 18 }
25 19
26 // IsTerminal returns true if the specified io.Writer is a terminal. 20 // IsTerminal returns true if the specified io.Writer is a terminal.
27 func IsTerminal(out io.Writer) bool { 21 func IsTerminal(out io.Writer) bool {
28 f, ok := out.(*os.File) 22 f, ok := out.(*os.File)
29 if !ok { 23 if !ok {
30 return false 24 return false
31 } 25 }
32 return terminal.IsTerminal(int(f.Fd())) 26 return terminal.IsTerminal(int(f.Fd()))
33 } 27 }
OLDNEW
« no previous file with comments | « client/cmd/isolate/batch_archive.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698