Commenting helpers package

This commit is contained in:
Ahsanul Haque
2014-12-12 02:57:25 +06:00
parent b11838da3f
commit 2c8e9a7931
4 changed files with 29 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ import (
"strings"
)
//Filepath separator defined by os.Separator.
const FilePathSeparator = string(filepath.Separator)
func FindAvailablePort() (*net.TCPAddr, error) {
@@ -39,6 +40,7 @@ func FindAvailablePort() (*net.TCPAddr, error) {
return nil, err
}
// InStringArray checks if a string is an element of a slice of strings and returns a boolean value.
func InStringArray(arr []string, el string) bool {
for _, v := range arr {
if v == el {
@@ -48,6 +50,7 @@ func InStringArray(arr []string, el string) bool {
return false
}
// GuessType attempts to guess the type of file from a given string.
func GuessType(in string) string {
switch strings.ToLower(in) {
case "md", "markdown", "mdown":