Created
April 26, 2018 09:40
-
-
Save trusch/05d6b0e590c2f921bf220c60f79818cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- 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