mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-01 12:08:37 -04:00
Initial commit
This commit is contained in:
17
util.go
Normal file
17
util.go
Normal file
@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetURLID(url string) (int64, error) {
|
||||
pieces := strings.Split(strings.Trim(url, "/"), "/")
|
||||
return strconv.ParseInt(pieces[len(pieces)-1], 10, 0)
|
||||
}
|
||||
|
||||
func WriteSuccess(w http.ResponseWriter) {
|
||||
fmt.Fprint(w, "{}")
|
||||
}
|
Reference in New Issue
Block a user