LINUX.ORG.RU

История изменений

Исправление dnb, (текущая версия) :

package main

import (
	"log"
	"net/http"
)

func main() {
	port := "8000"
	directory := "."

	http.Handle("/", http.FileServer(http.Dir(directory)))
	log.Fatal(http.ListenAndServe(":"+port, nil))
}

Исходная версия dnb, :

package main

import (
	"log"
	"net/http"
)

func main() {
	port := 8000
	directory := "."

	http.Handle("/", http.FileServer(http.Dir(*directory)))
	log.Fatal(http.ListenAndServe(":"+*port, nil))
}