aboutsummaryrefslogtreecommitdiff
path: root/lib/os/example_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-04-05 23:44:02 +0700
committerShulhan <ms@kilabit.info>2023-04-08 16:56:26 +0700
commitd8ed8a6b7d788eb6bb59023e6e6fe93190b8a2c8 (patch)
treeadaca1b1e11401e52624ae13ca39dceb95a83cc0 /lib/os/example_test.go
parent78e301986dceacc8daa7cb3f549859a005b2b9b8 (diff)
downloadpakakeh.go-d8ed8a6b7d788eb6bb59023e6e6fe93190b8a2c8.tar.xz
lib/os: merge some functions from lib/io
Functions like Copy, IsBinary, IsDirEmpty, IsFileExist, RmdirEmptyAll are read and operate on file and directory on operating system level, so it is not correct to put it in package io.
Diffstat (limited to 'lib/os/example_test.go')
-rw-r--r--lib/os/example_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/os/example_test.go b/lib/os/example_test.go
new file mode 100644
index 00000000..00c82638
--- /dev/null
+++ b/lib/os/example_test.go
@@ -0,0 +1,19 @@
+// Copyright 2023, Shulhan <ms@kilabit.info>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package os_test
+
+import (
+ "fmt"
+
+ libos "github.com/shuLhan/share/lib/os"
+)
+
+func ExampleIsBinary() {
+ fmt.Println(libos.IsBinary("/bin/bash"))
+ fmt.Println(libos.IsBinary("io.go"))
+ // Output:
+ // true
+ // false
+}