[TDD] : getdirname and get so file path , get conf file path
authorjaehoon.hyun <jaehoon.hyun@samsung.com>
Wed, 27 Mar 2019 05:15:31 +0000 (14:15 +0900)
committerjaehoon.hyun <jaehoon.hyun@samsung.com>
Wed, 27 Mar 2019 05:15:48 +0000 (14:15 +0900)
src/configuremgr/incubator/getdirname.go [new file with mode: 0644]

diff --git a/src/configuremgr/incubator/getdirname.go b/src/configuremgr/incubator/getdirname.go
new file mode 100644 (file)
index 0000000..752b439
--- /dev/null
@@ -0,0 +1,24 @@
+package main
+
+import (
+       "fmt"
+       "strings"
+)
+
+func main() {
+    getdirname()
+}
+
+func getdirname() {
+
+       path := "/tmp/foo/simple"
+
+       dirname := path[strings.LastIndex(path, "/") + 1:]
+
+       soPath   := path + "/" + dirname + ".so"
+       confPath := path + "/" + dirname + ".conf"
+
+       fmt.Println("soPath   : " + soPath)
+       fmt.Println("confPath : " + confPath)
+
+}
\ No newline at end of file