[34] Results

Javascript : Empty an array example

javascript empty-array pop-array

Problem :

You have an array in JavaScript and you need to empty it. How to do that?

For instance….... read more

Golang : How to check for empty array string or string?

golang string check-empty-string string-array

Sometimes that most obvious thing can be the hardest to remember. Putting this down as a note for myself and….... read more

Golang : How to check if slice or array is empty?

golang sql check-empty-slice-array err-no-rows sql

Problem :

One of your code is throwing out panic error and apparently it is trying to do a for….... read more

Golang : Determine if directory is empty with os.File.Readdir() function

golang empty-directory readdir filepath-walk

Problem :

You are traversing a directory tree with filepath.Walk() function and you need to find out if a directory….... read more

Golang : Convert file content into array of bytes

golang array

It is a fairly common requirement to read a file content into array of bytes and output those arrays back to a file. In this….... read more

Golang : Iterate map

golang iterate string array

Got a question by a friend asking how to how to iterate through a map in Golang today. Thought that….... read more

Golang : Squaring elements in array

golang square elements array

Problem :

You need to calculate the square values of the elements in an array or slice.

Solution :

.... read more

Golang : Map within a map example

golang map array

Just an example of map within map in Golang. The example below demonstrates how to put declare a map with….... read more