# Twtxt is an open, distributed microblogging platform that # uses human-readable text files, common transport protocols, # and free software. # # Learn more about twtxt at https://github.com/buckket/twtxt # # This is an automated Yarn.social feed running feeds v0.1.0@72e53a9 # Learn more about Yarn.social at https://yarn.social # # nick = golangcode # url = https://feeds.twtxt.net/golangcode/twtxt.txt # type = rss # source = https://golangcode.com/index.xml # avatar = # description = # updated_at = 2021-12-05T23:51:54Z # 2020-06-29T19:00:00Z Validating an Email Address ⌘ [Read more...](https://golangcode.com/validate-an-email-address/) 2020-05-22T21:00:00Z Take a Screenshot of a Webpage with Headless Chrome ⌘ [Read more...](https://golangcode.com/headless-chrome-screenshot/) 2020-05-10T15:00:00Z URL Encode a String ⌘ [Read more...](https://golangcode.com/url-encode-value/) 2020-04-17T17:00:00Z Exit an Application, With or Without an Error Code ⌘ [Read more...](https://golangcode.com/exit-application-with-error-code/) 2020-03-29T20:00:00Z Connect to PostgreSQL and Run a Query ⌘ [Read more...](https://golangcode.com/postgresql-connect-and-query/) 2020-03-13T16:00:00Z How to: Handle Errors within Wait Groups ⌘ [Read more...](https://golangcode.com/errors-in-waitgroups/) 2020-02-22T10:00:00Z Mock S3 Uploads in Go Tests ⌘ [Read more...](https://golangcode.com/mocking-s3-upload/) 2020-01-25T10:00:00Z Argon2 Password Hashing ⌘ [Read more...](https://golangcode.com/argon2-password-hashing/) 2020-01-11T15:00:00Z Perform Sentiment Analysis on Sentences ⌘ [Read more...](https://golangcode.com/sentiment-analysis-on-strings/) 2019-12-07T18:00:00Z Foreach Loops: The Go Way ⌘ [Read more...](https://golangcode.com/foreach-loops/) 2019-10-26T08:00:00Z Build a Basic Web Scraper in Go ⌘ [Read more...](https://golangcode.com/basic-web-scraper/) 2019-10-25T19:20:00Z Get the IP Address of a HTTP Request ⌘ [Read more...](https://golangcode.com/get-the-request-ip-addr/) 2019-09-29T06:20:00Z Convert iota List to String in JSON ⌘ [Read more...](https://golangcode.com/convert-iota-to-string-in-json/) 2019-09-24T18:20:00Z How to Run a Single Test ⌘ [Read more...](https://golangcode.com/run-one-test/) 2019-09-19T18:30:00Z Generate a PDF in Go ⌘ [Read more...](https://golangcode.com/generate-a-pdf/) 2019-08-26T17:50:00Z JSON Web Tokens: Authenticating your API ⌘ [Read more...](https://golangcode.com/api-auth-with-jwt/) 2019-08-16T17:00:00Z Check Element Exists in a Slice ⌘ [Read more...](https://golangcode.com/check-if-element-exists-in-slice/) 2019-08-08T17:00:00Z Read a File to String ⌘ [Read more...](https://golangcode.com/read-a-files-contents/) 2019-07-23T17:00:00Z Timeout a Function Call (with Goroutines & Channels) ⌘ [Read more...](https://golangcode.com/timing-out-a-goroutine/) 2019-07-04T13:00:00Z Find Common Colours in an Image ⌘ [Read more...](https://golangcode.com/find-common-colours-in-image/) 2019-06-29T19:00:00Z How to Check If a String Starts With ... ⌘ [Read more...](https://golangcode.com/check-if-string-starts-with/) 2019-06-09T10:00:00Z Working with POST Request Data ⌘ [Read more...](https://golangcode.com/handle-post-request-data/) 2019-06-07T11:00:00Z Go Get: Install All Packages ⌘ [Read more...](https://golangcode.com/go-get-all-packages/) 2019-06-01T07:00:00Z Sublime Text Workflow: Auto Build & Format ⌘ [Read more...](https://golangcode.com/sublime-text-go-workflow/) 2019-05-03T18:00:00Z JSON Encode - Pretty Print ⌘ [Read more...](https://golangcode.com/json-encode-pretty-print/) 2019-02-24T13:00:00Z Basic Docker Setup for HTTP Server (using docker-compose) ⌘ [Read more...](https://golangcode.com/basic-docker-setup/) 2019-02-16T09:00:00Z Check If a Date/Time Has Been Set with IsZero ⌘ [Read more...](https://golangcode.com/checking-if-date-has-been-set/) 2019-02-02T09:00:00Z Is Long/Lat within Polygon from GeoJson ⌘ [Read more...](https://golangcode.com/is-point-within-polygon-from-geojson/) 2019-01-28T11:00:00Z Convert Interface to Type: Type Assertion ⌘ [Read more...](https://golangcode.com/convert-interface-to-number/) 2019-01-19T17:00:00Z Run Code Once on First Load (Concurrency Safe) ⌘ [Read more...](https://golangcode.com/run-code-once-with-sync/) 2019-01-14T20:20:00Z Disable Log Output During Tests ⌘ [Read more...](https://golangcode.com/disable-log-output-during-tests/) 2019-01-10T20:20:00Z Sending a Slack Message (without a library) ⌘ [Read more...](https://golangcode.com/send-slack-messages-without-a-library/) 2018-12-21T16:20:00Z Create a Basic HTTPS Server (using TLS) ⌘ [Read more...](https://golangcode.com/basic-https-server-with-certificate/) 2018-11-04T19:20:00Z Waiting for Goroutines to Finish with a WaitGroup ⌘ [Read more...](https://golangcode.com/waiting-for-goroutines-to-finish/) 2018-10-25T20:20:00Z Parsing Dates from a String and Formatting ⌘ [Read more...](https://golangcode.com/parsing-dates/) 2018-10-06T20:30:00Z Run System Commands & Binary Files ⌘ [Read more...](https://golangcode.com/execute-a-command/) 2018-08-10T19:30:00Z Sorting an Array of Numbered String Values ⌘ [Read more...](https://golangcode.com/sorting-an-array-of-numeric-items/) 2018-07-06T19:00:00Z Creating & Writing to Temp Files ⌘ [Read more...](https://golangcode.com/creating-temp-files/) 2018-06-30T12:00:00Z Encode and Decode Strings using Base 64 ⌘ [Read more...](https://golangcode.com/base-64-encode-decode/) 2018-06-20T19:00:00Z HTTP Get Request with Timeout ⌘ [Read more...](https://golangcode.com/http-get-with-timeout/) 2018-06-08T15:00:00Z Get the HTTP Method from a Request ⌘ [Read more...](https://golangcode.com/get-http-method-from-request/) 2018-05-29T09:00:00Z AWS Lambda PDF Generator ⌘ [Read more...](https://golangcode.com/lambda-pdf-generator-from-s3/) 2018-05-05T09:00:00Z Substring: How to Split a String ⌘ [Read more...](https://golangcode.com/substring-num-of-characters/) 2018-03-30T00:20:00Z Apply Middleware to Your Route Handlers ⌘ [Read more...](https://golangcode.com/middleware-on-handlers/) 2018-03-24T00:20:00Z Generating a SHA256 HMAC Hash ⌘ [Read more...](https://golangcode.com/generate-sha256-hmac/) 2018-02-09T20:20:00Z Converting a PDF to JPG (using ImageMagick) ⌘ [Read more...](https://golangcode.com/convert-pdf-to-jpg/) 2018-02-03T10:40:00Z Creating, Wrapping and Handling Errors ⌘ [Read more...](https://golangcode.com/custom-error-messages/) 2018-01-21T10:40:00Z Struct Tags for Encoding/Decoding Data ⌘ [Read more...](https://golangcode.com/struct-tags/) 2018-01-20T10:45:00Z Convert uint64 to a String ⌘ [Read more...](https://golangcode.com/uint64-to-string/) 2017-12-30T12:45:00Z Print The Current Memory Usage ⌘ [Read more...](https://golangcode.com/print-the-current-memory-usage/) 2017-12-17T11:00:00Z While True: Looping in Go ⌘ [Read more...](https://golangcode.com/while-true/) 2017-12-07T20:00:00Z How Long Does a Function Take: Measuring Execution Time ⌘ [Read more...](https://golangcode.com/function-execution-time/) 2017-12-04T21:00:00Z How Detect Content Type of a File ⌘ [Read more...](https://golangcode.com/get-the-content-type-of-file/) 2017-11-05T10:00:00Z Handle Ctrl+C (Signal Interrupt) Close in the Terminal ⌘ [Read more...](https://golangcode.com/handle-ctrl-c-exit-in-terminal/) 2017-11-03T20:05:00Z Part 2) Download Large Files with Progress Reports ⌘ [Read more...](https://golangcode.com/download-a-file-with-progress/) 2017-11-02T20:00:00Z Part 1) Download a File (from a URL) ⌘ [Read more...](https://golangcode.com/download-a-file-from-a-url/) 2017-11-01T19:35:00Z Check If a File Exists Before Using It ⌘ [Read more...](https://golangcode.com/check-if-a-file-exists/) 2017-10-20T11:35:00Z Search and Replace in a String ⌘ [Read more...](https://golangcode.com/search-and-replace-in-a-string/) 2017-09-28T21:35:00Z Set a HTTP Cookie Response Header ⌘ [Read more...](https://golangcode.com/add-a-http-cookie/) 2017-09-14T21:40:00Z Read a CSV File into a Struct ⌘ [Read more...](https://golangcode.com/how-to-read-a-csv-file-into-a-struct/) 2017-08-20T11:40:00Z Uploading a File to AWS S3 ⌘ [Read more...](https://golangcode.com/uploading-a-file-to-s3/) 2017-08-10T21:00:00Z Generating a Random Number ⌘ [Read more...](https://golangcode.com/generate-random-numbers/) 2017-08-07T21:00:00Z Print a Variable's Type (e.g. Int, String, Float) ⌘ [Read more...](https://golangcode.com/print-variable-type/) 2017-08-07T17:00:00Z Converting an Int to a String ⌘ [Read more...](https://golangcode.com/converting-and-int-to-string/) 2017-08-06T14:00:00Z HTTP Response Status Codes ⌘ [Read more...](https://golangcode.com/get-the-http-response-status-code/) 2017-08-06T13:00:00Z Passing Data between Go Routines with Channels ⌘ [Read more...](https://golangcode.com/basic-channels/) 2017-07-30T19:23:08Z About ⌘ [Read more...](https://golangcode.com/about/) 2017-07-30T19:23:08Z Privacy Policy ⌘ [Read more...](https://golangcode.com/privacy/) 2017-07-30T19:23:08Z Search ⌘ [Read more...](https://golangcode.com/search/) 2017-07-10T10:59:26Z Get and Set Environment Variables ⌘ [Read more...](https://golangcode.com/get-and-set-environment-variables/) 2017-06-08T11:24:10Z Unzip Files in Go ⌘ [Read more...](https://golangcode.com/unzip-files-in-go/) 2017-06-08T10:51:35Z Create Zip Files in Go ⌘ [Read more...](https://golangcode.com/create-zip-files-in-go/) 2017-06-06T10:46:59Z Cross Platform File Paths ⌘ [Read more...](https://golangcode.com/cross-platform-file-paths/) 2017-06-01T08:48:37Z How to Run Go Tests with Coverage Percentage ⌘ [Read more...](https://golangcode.com/how-to-run-go-tests-with-coverage-percentage/) 2017-05-30T08:33:51Z How to Check if a String is a URL ⌘ [Read more...](https://golangcode.com/how-to-check-if-a-string-is-a-url/) 2017-05-27T08:26:11Z Updating Go on Ubuntu/Linux ⌘ [Read more...](https://golangcode.com/updating-go-on-ubuntu/) 2017-05-03T19:45:38Z Sleeping in Go – How to Pause Execution ⌘ [Read more...](https://golangcode.com/sleeping-with-go/) 2017-05-02T18:21:48Z Detect if Code is Running On Windows (at Runtime) ⌘ [Read more...](https://golangcode.com/detect-if-code-is-running-on-windows-at-runtime/) 2017-04-26T20:08:59Z Get the Current Username, Name and Home Dir (Cross Platform) ⌘ [Read more...](https://golangcode.com/get-the-current-username-name-and-home-dir-cross-platform/) 2017-04-14T08:01:05Z Remove all Non-Alphanumeric Characters from a String (with help from regexp) ⌘ [Read more...](https://golangcode.com/how-to-remove-all-non-alphanumerical-characters-from-a-string/) 2017-04-09T10:55:07Z Get a URL Parameter from a Request ⌘ [Read more...](https://golangcode.com/get-a-url-parameter-from-a-request/) 2017-02-05T09:07:44Z Add Line Numbers to Log Output ⌘ [Read more...](https://golangcode.com/add-line-numbers-to-log-output/) 2016-06-10T10:08:48Z Convert io.ReadCloser to a String ⌘ [Read more...](https://golangcode.com/convert-io-readcloser-to-a-string/) 2016-05-29T17:37:45Z How to Install Go on Ubuntu 18.04/20.04 ⌘ [Read more...](https://golangcode.com/how-to-install-go-in-ubuntu-16-04/) 2016-05-22T11:54:24Z Serve Static Assets (using the Mux Router) ⌘ [Read more...](https://golangcode.com/serve-static-assets-using-the-mux-router/) 2016-03-31T17:48:21Z Fizz-Buzz Test in Go ⌘ [Read more...](https://golangcode.com/fizz-buzz-test-in-go/) 2016-03-24T18:31:09Z MySQL Database Insert & Get Last Insert ID ⌘ [Read more...](https://golangcode.com/mysql-database-insert-get-last-insert-id/) 2016-03-22T18:19:38Z Multi-line Strings ⌘ [Read more...](https://golangcode.com/multi-line-strings/) 2015-08-30T10:05:07Z Anonymous Functions (aka Closures) ⌘ [Read more...](https://golangcode.com/anonymous-functions/) 2015-08-30T09:34:15Z Basic Go Routines (like Threading) ⌘ [Read more...](https://golangcode.com/basic-go-routines-threading/) 2015-08-05T17:26:55Z Find the Length of an Array/Slice ⌘ [Read more...](https://golangcode.com/find-the-length-of-an-array/) 2015-08-03T20:05:16Z Write data to a CSV file ⌘ [Read more...](https://golangcode.com/write-data-to-a-csv-file/) 2015-08-02T19:29:45Z Passing Arguments into your Application ⌘ [Read more...](https://golangcode.com/pass-arguments-into-you-application/) 2015-08-02T11:50:20Z Writing to a File ⌘ [Read more...](https://golangcode.com/writing-to-file/) 2015-08-02T11:22:13Z Using Constants ⌘ [Read more...](https://golangcode.com/using-constants/) 2015-08-02T11:03:43Z Get the Current Unix Time ⌘ [Read more...](https://golangcode.com/get-unix-time/) 2015-08-01T15:18:12Z Attach a Logger to your Router ⌘ [Read more...](https://golangcode.com/attach-a-logger-to-your-router/) 2015-08-01T13:07:52Z JSON Decode into Objects ⌘ [Read more...](https://golangcode.com/json-decode-into-objects/) 2015-08-01T12:25:53Z JSON Encode an Array of Objects ⌘ [Read more...](https://golangcode.com/json-encode-an-array-of-objects/) 2015-08-01T11:08:00Z Using HTML Templates from a Folder (Complied) ⌘ [Read more...](https://golangcode.com/using-html-templates-from-a-folder-complied/) 2015-07-30T19:23:08Z Hello world! How to Start any Go Application ⌘ [Read more...](https://golangcode.com/hello-world/) 2021-11-03T15:00:00Z **Struct Tags with Underscore Before Function Names**
In the Go world, an underscore (\_) before an expression is called a blank identifier. As you may already know, identifiers—user-defined program components, e.g., name of a function, variable, or package—in Go must be preceded by an underscore or a letter (a-z or A-Z). If they aren’t, you’ll receive the compile- time error which essentially means Go cannot read the syntax of your code (you didn’t write your code correctly ... ⌘ [Read more](https://golangcode.com/using-go-struct-tags-with-an-underscore-before-function-names/) 2021-12-05T15:00:00Z **Underscores in Imports**
Underscores in Imports Underscores in Go serve a few purposes. In U+005F, “\_” is a letter (as a string). You may also see them as [ “\_” ] in between successive digits and a base prefix. In this case, it’s to improve the readability of the code. You may also see them in function names, e.g., imaginary\_lit.
The underscore is quite a versatile tool. They even have their place in defining the kind of action that will take place in a function. ⌘ [Read more](https://golangcode.com/underscores-in-imports/)