This commit is contained in:
Mark McGranaghan 2012-09-18 21:33:52 -07:00
parent e8c02ab241
commit f1b5e45784
3 changed files with 33 additions and 1 deletions

2
README
View File

@ -64,7 +64,6 @@ gobyexample.com signups
* environment variables
* dns
* timers
* url
* tty
* iota
* apps with multiple named binaries
@ -79,6 +78,7 @@ gobyexample.com signups
* oauth for google domains
* connection pool
* typed json parse/unparse
* blackfriday
= program ideas
command line client for public json api

23
src/xx-url.go Normal file
View File

@ -0,0 +1,23 @@
package main
import ("fmt"; "net/url"; "strings")
func main() {
u, err := url.Parse("postgres://user:pass@host.com:5432/path?k=v#frag")
if err != nil { panic(err) }
fmt.Println(u.Scheme)
fmt.Println(u.User)
fmt.Println(u.User.Username())
p, _ := u.User.Password()
fmt.Println(p)
fmt.Println(u.Host)
split := strings.Split(u.Host, ":")
fmt.Println(split[0])
fmt.Println(split[1])
fmt.Println(u.Path)
fmt.Println(u.Fragment)
fmt.Println(u.RawQuery)
m, _ := url.ParseQuery(u.RawQuery)
fmt.Println(m)
fmt.Println(m["k"][0])
}

9
www/brand.md Normal file
View File

@ -0,0 +1,9 @@
## brand
* colors
* font
* monaco
* helvetica neue
* twitter icon
{ }