diff --git a/src/github.com/microsoft/vscode-remote-try-go/hello/hello.go b/src/github.com/microsoft/vscode-remote-try-go/hello/hello.go new file mode 100644 index 0000000..f0b1780 --- /dev/null +++ b/src/github.com/microsoft/vscode-remote-try-go/hello/hello.go @@ -0,0 +1,8 @@ +package hello + +import () + +// Hello writes a welcome string +func Hello() string { + return "Hello golang!" +} diff --git a/server.go b/src/github.com/microsoft/vscode-remote-try-go/main/server.go similarity index 75% rename from server.go rename to src/github.com/microsoft/vscode-remote-try-go/main/server.go index 90bfbb3..ee37faa 100644 --- a/server.go +++ b/src/github.com/microsoft/vscode-remote-try-go/main/server.go @@ -7,17 +7,18 @@ package main import ( "fmt" + "github.com/microsoft/vscode-remote-try-go/hello" "io" "net/http" ) -func hello(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "Hello remote world!") +func helloOld(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, hello.Hello()) } func main() { portNumber := "9000" - http.HandleFunc("/", hello) + http.HandleFunc("/", helloOld) fmt.Println("Server listening on port ", portNumber) http.ListenAndServe(":"+portNumber, nil) }