draft designs for file system interfaces & file embedding

525 views
Skip to first unread message

Russ Cox

unread,
Jul 21, 2020, 11:22:30 AM7/21/20
to golang-nuts
Hi all,

I've posted two draft designs: one introducing general-purpose file system interfaces, with Rob Pike; and one for embedding files into Go programs, with Brad Fitzpatrick. These are draft designs we're circulating for feedback, not official proposals. (We certainly hope they will be well received and can be made into proposals, but that's not where we are today.)

If you are interested, there are docs and videos linked below. Because it worked well for the //go:build draft design, we're using Reddit again for the discussion, also linked below. Reddit's proper threading support scales better than GitHub or a single large mail thread. But for those who don't want to use Reddit, I will keep an eye on this thread as well and reply as best I can.

io/fs draft design
 - Video: https://golang.org/s/draft-iofs-video
 - Design: https://golang.org/s/draft-iofs-design
 - Q&A: https://golang.org/s/draft-iofs-reddit

//go:embed draft design
 - Video: https://golang.org/s/draft-embed-video
 - Design: https://golang.org/s/draft-embed-design
 - Q&A: https://golang.org/s/draft-embed-reddit

Thanks!

Best,
Russ

Constantine Vassilev

unread,
Nov 28, 2020, 1:27:56 PM11/28/20
to golang-nuts
I would like to test it. How to install the go 1.16 tip version?

Ian Lance Taylor

unread,
Nov 28, 2020, 3:08:29 PM11/28/20
to Constantine Vassilev, golang-nuts
On Sat, Nov 28, 2020 at 10:27 AM Constantine Vassilev
<const...@topinvestor.app> wrote:
>
> I would like to test it. How to install the go 1.16 tip version?

See https://golang.org/doc/install/source .

Ian

Constantine Vassilev

unread,
Nov 28, 2020, 3:59:21 PM11/28/20
to golang-nuts
I generated it from the source. I that the version I need?

go version devel +4ce0a7cea6 Sat Nov 28 18:42:44 2020 +0000 darwin/amd64

peterGo

unread,
Nov 29, 2020, 9:38:56 AM11/29/20
to golang-nuts
On Saturday, November 28, 2020 at 3:59:21 PM UTC-5 Constantine Vassilev wrote:
I generated it from the source. I that the version I need?

go version devel +4ce0a7cea6 Sat Nov 28 18:42:44 2020 +0000 darwin/amd64

 For the moment. The tip is constantly updated for development and bug fixes.

Go Build Dashboard

https://build.golang.org/

To test leading-edge features, update the tip regularly. For example, I perform a git pull and make.bash every day.

Peter

Constantine Vassilev

unread,
Nov 30, 2020, 12:00:29 PM11/30/20
to golang-nuts
Thank you for sharing your experience!

Constantine Vassilev

unread,
Nov 30, 2020, 12:59:32 PM11/30/20
to golang-nuts
I made it work with status web site in the folder "www":
---
package main

import (
"embed"
"log"
"net/http"
)

//go:embed www
var src embed.FS

func main() {

filehandler := http.FileServer(http.FS(src))
http.Handle("/", http.StripPrefix("/", filehandler))

// Run the web server.
log.Fatal(http.ListenAndServe(":8080", nil))
}
---
If use this link: http://localhost:8080/www/
the index.html inside is used to render the web site just fine.

When I make the request http://localhost:8080 I see the folder www
and have to click on it. I should not see the folder in that case.


On Tuesday, July 21, 2020 at 8:22:30 AM UTC-7 Russ Cox wrote:
Reply all
Reply to author
Forward
0 new messages