Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
830ccb66
Commit
830ccb66
authored
Dec 09, 2013
by
skyblue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial utils dir
parent
4fa625de
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
file.go
utils/file.go
+11
-0
file_test.go
utils/file_test.go
+13
-0
No files found.
utils/file.go
0 → 100644
View file @
830ccb66
package
utils
import
(
"os"
"path/filepath"
)
func
SelfPath
()
string
{
path
,
_
:=
filepath
.
Abs
(
os
.
Args
[
0
])
return
path
}
utils/file_test.go
0 → 100644
View file @
830ccb66
package
utils
import
(
"testing"
)
func
TestSelfPath
(
t
*
testing
.
T
)
{
path
:=
SelfPath
()
if
path
==
""
{
t
.
Error
(
"path cannot be empty"
)
}
t
.
Logf
(
"SelfPath: %s"
,
path
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment