Blog

Latest Articles

Browse the latest tutorials, guides, and practical examples across Linux, DevOps, security, databases, and programming on GoLinuxCloud.

Explore the latest tutorials and guides across Linux, DevOps, programming, and more.

You can also browse content by category below:

  • Linux: Commands, administration, troubleshooting, and system operations
  • DevOps: CI/CD, Kubernetes, containers, and automation
  • Cloud: AWS, Azure, OpenStack, and hybrid cloud administration
  • Programming: Coding tutorials, scripting, and development concepts
  • Security: Ethical hacking, system security, and best practices
  • Databases: MySQL, MariaDB, PostgreSQL, and database management
  • Networking: Network setup, troubleshooting, and protocols
  • Storage: Disk management, file systems, and storage solutions
  • Tools: Useful tools and utilities for productivity

2329 articles

Blog illustration with latest articles, tutorials, guides, and how-to content across Linux and DevOps topics
programming

Go comma ok idiom: map, type assertion, and channel receive

Golang comma ok idiom and go comma ok idiom: the second bool from v, ok := m[k], v, ok := x.(T), or v, ok := <-ch; comma ok idiom golang covers maps, type assertions, and closed channels—not the same as if err != nil.

Antony Shikubu3 min read
programming

Create a Go Module: go mod init, go.mod, and a Small Example

Learn golang create module workflow with go mod init to generate go.mod, pick a golang module name, enable modules by default, and add a nested package plus tests—without relying on GOPATH src layout.

Deepak Prasad5 min read
programming

Golang return multiple values from a function

Golang return multiple values and go function return multiple values: syntax, two-value returns, mixed types, blank identifiers, (T, error), and named results.

Deepak Prasad4 min read
programming

Golang return error: create, wrap, and check errors in Go

Golang return error and go return error: the error interface, errors.New and fmt.Errorf, if err checks, wrapping with %w, errors.Is and errors.As, and turning an error into a string.

Deepak Prasad4 min read
programming

Convert io.Reader or io.ReadCloser to a String in Go

Drain a golang io.Reader or io.ReadCloser into a string with io.ReadAll and string(b), or stream with strings.Builder and io.Copy or bytes.Buffer.ReadFrom; use strings.NewReader when you need a reader from a string.

Tuan Nguyen4 min read
programming

Go Type Casting: Conversions, Assertions, and Interface to Struct

Golang cast and go cast usually mean explicit type conversion (numeric) or type assertion from any: golang type casting vs strconv for strings, safe v.(T) and golang cast interface to struct with value or pointer types.

Deepak Prasad4 min read
programming

Change the Default log Package Prefix, Flags, and Output in Go

Go import log for the standard logger: change golang log format with SetFlags, add a golang log prefix with SetPrefix or log.New, use log.Printf for formatted lines, and send output to files or MultiWriter for console …

Antony Shikubu4 min read
programming

Golang remove from slice: delete element by index and while iterating

Golang remove from slice and delete element from slice golang: by index with order, swap-pop without order, first element, and safe patterns while iterating.

Tuan Nguyen3 min read
programming

Golang remove duplicates from slice: dedupe and unique values

Golang remove duplicates from slice: preserve order with a map, sort then Compact for sorted unique, counts with map, and the XOR trick for one odd-count value.

Deepak Prasad3 min read
programming

Convert a Go Byte Slice to io.Reader (and Reader Back to Bytes)

Turn a Go []byte or byte buffer into an io.Reader with bytes.NewReader, use strings.NewReader for text, then read with io.ReadAll or io.Copy when you need bytes or strings back from a reader.

Tuan Nguyen4 min read
programming

Golang HTML to Text: Strip Tags, Parse HTML, and Convert HTTP Body

Convert HTML to text in Go, strip HTML tags, read HTTP response body with io.ReadAll, parse HTML with golang.org/x/net/html, extract body text or body HTML, and know when html2text or bluemonday fits better.

Tuan Nguyen9 min read
programming

Golang URL Encode Decode: QueryEscape, PathEscape, and Query Params

URL encode and decode strings in Go with net/url: QueryEscape, QueryUnescape, PathEscape, PathUnescape, url.Values, ParseQuery, and url.Parse with RawQuery.

Tuan Nguyen6 min read
programming

Golang Type Assertion: Interface, Concrete Type, and Type Switch Examples

Learn how type assertion works in Go on interface values: concrete types, x.(T) vs comma-ok, panic rules, type switches, and how assertion differs from type conversion.

Tuan Nguyen9 min read
programming

Golang Variadic Function: ... Syntax, Varargs, and Slice Examples

Variadic functions in Go use ...T for the last parameter (varargs), behave like []T inside the body, and accept slice arguments with slice.... Compare ... at define vs call, mix fixed parameters, ...any, and common …

Deepak Prasad7 min read
programming

Golang remove backslash from string

Remove backslash from a string in Go with strings.ReplaceAll or strings.Replace, including raw literals and optional cleanup. Related: golang remove substring and golang remove characters.

Tuan Nguyen3 min read
programming

JavaScript splice(): Add, Remove, and Replace Array Elements

Learn JavaScript splice() with examples to remove, add, and replace array elements, understand mutation, return values, and slice vs splice.

Olorunfemi Akinlua2 min read
programming

Replace Substring in JavaScript with replace() and replaceAll()

Replace substrings in JavaScript with replace(), replaceAll(), regex, and replacement functions—first match, all matches, and capture groups.

Olorunfemi Akinlua3 min read
programming

Remove Last Character from String in JavaScript

Learn how to remove the last character from a string in JavaScript using slice(), substring(), replace(), and Unicode-safe Array.from() examples.

Olorunfemi Akinlua3 min read
programming

JavaScript Open New Tab with window.open()

Learn how to open a new tab in JavaScript with window.open(). See _blank examples, noopener and noreferrer, popup blocker rules, same-tab alternatives, and secure browser behavior.

Olorunfemi Akinlua3 min read
programming

JavaScript Merge Objects: Spread, Object.assign, and Deep Merge

Merge objects in JavaScript: spread, Object.assign, shallow vs deep copies, overwrite order, and when structuredClone fits.

Olorunfemi Akinlua3 min read
programming

Mediator Pattern in JavaScript: Practical JS Example

Mediator pattern in JavaScript: central coordinator, reduced coupling between components, when to prefer it over Observer, and a small runnable example.

Olorunfemi Akinlua3 min read
programming

JavaScript Observer pattern (EventTarget and custom pub/sub)

Implement the Observer pattern in JavaScript with EventTarget, callback lists, Pub/Sub differences, error handling, and avoiding listener leaks.

Olorunfemi Akinlua3 min read
programming

JavaScript Singleton Pattern with Class and Module Examples

Learn the JavaScript singleton pattern with class-based singleton, module singleton, getInstance examples, and when to avoid global state.

Olorunfemi Akinlua2 min read
programming

JavaScript Mouse Events: click, dblclick, mousedown, mouseup and mouseover

JavaScript mouse events: click, dblclick, mousedown, mouseup, mouseover, mouseenter, mouseout, mouseleave, mousemove, target, and coordinates—with Node-friendly snippets where possible.

Olorunfemi Akinlua3 min read
programming

JavaScript Remove Element from DOM with remove() and removeChild()

Learn how to remove DOM elements in JavaScript using element.remove(), parentNode.removeChild(), querySelector(), event handlers, and safe null checks.

Olorunfemi Akinlua3 min read
programming

JavaScript Replace DOM Element with replaceChild() and replaceWith()

Learn how to replace DOM elements in JavaScript using replaceChild(), replaceWith(), createElement(), text replacement, and safe element checks.

Olorunfemi Akinlua2 min read
programming

JavaScript scrollTo(): Scroll Window or Element Position

Learn JavaScript scrollTo() with window.scrollTo(), smooth scrolling, scroll to element, scrollIntoView(), and scroll position examples.

Olorunfemi Akinlua2 min read
programming

JavaScript YAML Parser: Parse YAML in Node.js

Learn how to parse YAML in JavaScript and Node.js with yaml and js-yaml, read YAML files, convert YAML to JSON, and handle parser errors safely.

Olorunfemi Akinlua4 min read
programming

JavaScript return vs throw: When to Return Errors or Throw

Understand return vs throw in JavaScript, when to return error values, when to throw errors, and how try...catch handles exceptions.

Olorunfemi Akinlua3 min read
programming

JavaScript JSON.parse(): Parse JSON Strings, Objects, and Files

JSON.parse in JavaScript: valid JSON strings, SyntaxError on bad input, reviver functions, and safe parsing habits.

Olorunfemi Akinlua2 min read