go-file-server GO HTTP 文件下载服务器
package main import ( "fmt" "log" "net/http" "os" "path/filepath" ) func main() { log.Println("Server Port: " + os.Args[1]) log.Println("Server Workdir: " + os.Args[2]) p, _ := filepath.Abs(filepath.Dir(os.Args[2] + "\\")) http.Handle("/", http.FileServer(http.Dir(p))) err := http.ListenAndServe(":"+os.Args[1], nil) if err != nil { fmt.Println(err) } }