Golang fmt.Scanner type example
package fmt
Scanner is implemented by any value that has a Scan method, which scans the input for the representation of a value and stores the result in the receiver, which must be a pointer to be useful. The Scan method is called for any argument to Scan, Scanf, or Scanln that implements it.
Golang fmt.Scanner type usage example
var arg interface{}
var err error
var verb rune
var s fmt.ScanState
// If the parameter has its own Scan method, use that.
if v, ok := arg.(Scanner); ok {
err = v.Scan(s, verb)
if err != nil {
if err == io.EOF {
err = io.ErrUnexpectedEOF
}
}
Reference :
Advertisement
Something interesting
Tutorials
+8.9k Golang : Sort lines of text example
+14.4k Golang : How to pass map to html template and access the map's elements
+4.7k Golang : How to pass data between controllers with JSON Web Token
+15.2k Golang : Save(pipe) HTTP response into a file
+18.2k Golang : Put UTF8 text on OpenCV video capture image frame
+9.1k Golang : Serving HTTP and Websocket from different ports in a program example
+16.8k Golang : read gzipped http response
+5.5k Golang : Stop goroutine without channel
+9.7k Golang : Detect number of active displays and the display's resolution
+26.4k Golang : Get executable name behind process ID example
+5.4k Python : Delay with time.sleep() function example
+6.3k Golang : Detect face in uploaded photo like GPlus