Skip to content

Instantly share code, notes, and snippets.

@trusch
Created April 26, 2018 09:40
Show Gist options
  • Save trusch/05d6b0e590c2f921bf220c60f79818cd to your computer and use it in GitHub Desktop.
Save trusch/05d6b0e590c2f921bf220c60f79818cd to your computer and use it in GitHub Desktop.
// -*- mode:go;mode:go-playground -*-
// snippet of code @ 2018-04-26 11:36:33
// === Go Playground ===
// Execute the snippet with Ctl-Return
// Remove the snippet completely with its dir and all files M-x `go-playground-rm`
package main
import (
"fmt"
"net/url"
"path/filepath"
)
func main() {
str := "http://foo.bar:5000"
uri, _ := url.Parse(str)
fmt.Println(filepath.Join(uri.Host, "foobar"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment