Refer to “Git.io: GitHub URL Shortener”.
- cURL as DSL — cURL as DSL 1.0 documentation
- shibukawa/curl_as_dsl (coded by golang)
package gitioapi_test
import (
"fmt"
"github.com/spiegel-im-spiegel/gitioapi"
)
func ExampleEncode() {
shortUrl, _ := gitioapi.Encode(&gitioapi.Param{Url: "https://github.com/technoweenie", Code: "t"})
fmt.Print(shortUrl)
// http://git.io/t:
}
func ExampleDecode() {
shortUrl, _ := gitioapi.Decode(&gitioapi.Param{Url: "http://git.io/t"})
fmt.Print(shortUrl)
// https://github.com/technoweenie
}
These codes are licensed under CC0.