 
  		        ludofischer
  									Author of React for Real
  			          
  						Powerful Command-Line Applications in Go: 'go vet' reports error (server_test.go)
In chapter 8, Talking to REST APIs, section Testing the REST API Server, the following snippet in server_test.go triggers a warning from go vet:
			r, err := http.Get(url + tc.path)
			defer r.Body.Close()
			if err != nil {
				t.Error(err)
			}
‘using r before cheking for errors’.  To clear this warning, we must move the defer statement after the error check like this:
			r, err := http.Get(url + tc.path)
			if err != nil {
				t.Error(err)
			}
			defer r.Body.Close()
Most Liked
 
		        rgerardi
									Author of Powerful Command-Line Applications in Go
			          
						Thank you for catching it. It has been fixed now.
	                    1
	                
	                
	            Popular Pragmatic Bookshelf topics
                         
                      
                       
          
                When I try the command to create a pair of migration files I get an error. 
user=> (create-migration "guestbook")
Execution error (Ill...
              
            
            
          
              New
 
          
                Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) 
It looks like 
    .with_simple_console_no_bg(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
              
            
            
          
              New
 
          
                Hi Jamis, 
I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. 
This test doesn’t pass for me: 
 ...
              
            
            
          
              New
 
          
                Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
              
            
            
          
              New
 
          
                Hi @venkats, 
It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
              
            
            
          
              New
 
          
                I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. 
How to replicate: 
load chapter-7 from zipfile i...
              
            
            
          
              New
 
          
                In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
              
            
            
          
              New
 
          
                When installing Cards as an editable package, I get the following error: 
ERROR: File “setup.py” not found. Directory cannot be installe...
              
            
            
          
              New
 
          
                I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. 
Iteration A1 - Seeing the list of prod...
              
            
            
          
              New
 
          
                @mfazio23
Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141.  Googl...
              
            
            
          
              New
Other popular topics
                         
                      
                       
          
                No chair. I have a standing desk. 
This post was split into a dedicated thread from our thread about chairs :slight_smile:
              
            
            
          
              New
 
          
                My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
              
            
            
          
              New
 
          
                There’s a whole world of custom keycaps out there that I didn’t know existed! 
Check out all of our Keycaps threads here: 
https://forum....
              
            
            
          
              New
 
          
                I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
              
            
            
          
              New
 
          
                Use WebRTC to build web applications that stream media and data in real time directly from one user to another, all in the browser.
  
...
              
            
            
              
          
              New
 
          
                Author Spotlight 
Jamis Buck 
@jamis 
This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
              
            
            
          
              New
 
          
                Author Spotlight: 
Karl Stolley 
@karlstolley 
Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
              
            
            
          
              New
 
          
                Jan | Rethink the Computer. 
Jan turns your computer into an AI machine by running LLMs locally on your computer. It’s a privacy-focus, l...
              
            
            
              
          
              New
 
          
                This is cool! 
DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON
We just witnessed something incredible: the largest open-s...
              
            
            
          
              New
 
          
                Ask Me Anything with 
Mark Volkmann 
@mvolkmann 
On February 24 and 25, we are giving you a chance to ask questions of PragProg author M...
              
            
            
          
              New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /python
- /rails
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /haskell
- /emacs
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /zig
- /deepseek
- /scala
- /sublime-text
- /lisp
- /textmate
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /revery
- /deno
- /ubuntu
- /spring
- /nodejs
- /manjaro
- /diversity
- /lua
- /julia
- /slackware
- /c
 
    





