Giter VIP home page Giter VIP logo

go1's Issues

Chapter 1, struct, nil value

When you create a Movie without a value for the string property, you say that it will have a zero value of nil. This is not the case - the property is a string and will have a zero value of "" (empty string). A struct with no value itself will be nil, not the property.

I cannot find an errata page for the book (I have a physical copy) - but if you could change it for the digital version...

bcrypt import deprecated

Hi,
Just a little in convenience:
In user.go import need to be updated to "golang.org/x/crypto/bcrypt"

The bcrypt package adress has changed.

The import below has to be changed,

  • import "code.google.com/p/go.crypto/bcrypt"
    to,
  • import "golang.org/x/crypto/bcrypt"

you find that in many files, if you gonna maintain the repo I can change and send a PR.

chapter4 "go run main.go" gives out error

when i do:

$ cd chaptert4/2_first_template
$ go run main.go

I get error:

command-line-arguments

./main.go:9: undefined: RenderTemplate

what am i doing wrong? (same with go build)

CSS files are not served.

Hi,
in chapter4/4_httprouter/main.go the line

http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("assets/"))))

even if I use the following code:

filesRourter := NewRouter()
filesRourter.ServeFiles("/assets/css/*filepath", http.Dir("assets/"))

doesn't allow the browser to access the css files, the pase has not a style.
I'm using go1.7.1 and the httprouter last commit is 4563b0b.
Could you please fix it?
Thanks

Update bcrypt import

Hi,
Just a little inconvenience:
In user.go import need to be updated to "golang.org/x/crypto/bcrypt"

Chapter 7_4

I receive the following error when trying to run Chapter 7 part 4:

Error rendering template users/show
template: layout.html:31:5: executing "layout.html" at : error calling yield: template: show.html:11:18: executing "users/show" at <.User.Id>: Id is not a field of struct type interface {}

I resolved it by changing 'User.Id' to 'User.ID'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.