Skip to content

Commit 9c0bc7f

Browse files
committed
Get the server port by calling the method, not taking its address.
1 parent 8854056 commit 9c0bc7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func StartBlogServer(blog *Blog) error {
5858

5959
http.Handle("/", server)
6060

61-
fmt.Printf("Starting blog server on port %d\n", blog.Port)
62-
return http.ListenAndServe(fmt.Sprintf(":%d", blog.Port), nil)
61+
fmt.Printf("Starting blog server on port %d\n", blog.Port())
62+
return http.ListenAndServe(fmt.Sprintf(":%d", blog.Port()), nil)
6363
}
6464

6565
func (b *blogServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {

0 commit comments

Comments
 (0)