Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Parse XML Data In A Golang Application

While I don’t see a lot of it anymore, XML is still a common data format that people use. I prefer JSON, but I don’t always have a say in how I receive data. Some time ago I wrote a few tutorials on which include parsing XML data with Node.js, parsing XML data with Java, and parsing XML data with PHP. If you’ve been keeping up, I’ve been doing a lot of development with the Go programming language which is why I think it would be a great idea to go over XML in Golang.

Of the various programming languages, I think XML is the easiest to work with in the Go programming language. We’re going to see how to take XML data and unmarshal it into a custom structure. We’re also going to see how to take JSON data and convert it into XML.

Read More

Unit Testing A Golang Application That Includes HTTP

When building a great application, it is a good idea to plan for proper testing of each of the components that make the application tick. Through unit testing, we can test each function within the application as a separate entity, to make sure it performs based on our testing criteria.

But how do you do this in a Golang application? What if you need to test endpoints that were created using the Gorilla mux package?

We’re going to see how to develop unit tests for our functions as well as HTTP endpoints in a Golang application using the available Go testing framework.

Read More

Determine If A Number Is Prime Using The Go Programming Language

Almost two years ago I wrote an article explaining how to determine if a number is prime or not using JavaScript. It turns out this article became more popular than I thought it would, and if I had to guess, it might be because it is a good computer science and overall interview question for new career developers.

I thought it would make sense to revisit the post, but this time focus on accomplishing the task with the Go programming language instead of JavaScript.

Read More

The Fibonacci Sequence Printed With Golang

I figured I would change it up a bit and get into the basics of Golang and common Computer Science study material taught in school, but often used in software engineering type positions. We’re going to revisit a post I wrote back in 2015 regarding the Fibonacci number and generating the sequence in JavaScript. This time I figured it would be useful to walk through how to accomplish the same using the Go programming language.

Why do I want to talk about Fibonacci related material?

Well, it is a good way to learn about a development language such as Golang and like I said previously, it would benefit you as a refresher when it comes to interviewing for a job.

Read More

Add Type Definitions To An External JavaScript File In TypeScript

Not too long ago I wrote an article that explained how to include external JavaScript libraries in an Angular TypeScript project. To summarize that post, my goal was to show how to use any of the millions of JavaScript libraries that exist online within a TypeScript application. I received a lot of heat from that article saying that I am missing the point of TypeScript because in the end I wasn’t using any type definitions. I disagree because not every library that exists on the internet will have a set of type definitions. In that sense the article still proves very useful.

This time around, I want to explain how to include type definitions in your project, should they exist. I won’t be going over the entire Angular demo again, but the JavaScript library will be the same and it will still be a functional application.

Read More

Include External JavaScript Libraries In An Angular TypeScript Project

I’ve been a JavaScript developer for a while now, but with the release of Angular, I’ve been inspired to pick up TypeScript. However, what happens when I want to use one of my hundreds of available external JavaScript libraries in my project?

I’m going to share how to use your favorite JavaScript libraries in a TypeScript Angular application.

Read More

Waiting For A Loop Of Async Functions To Finish In Node.js

At the moment Node.js is my web development language of choice, but occasionally I come across something that really grinds my gears. I sometimes find that I’ve fallen into an async hell that screws up a lot of things. For example, maybe I’ve designed an API endpoint that makes a few requests to external services. Before returning data to the client (user), manipulations must be done on the external service data requested. How do we do all this?

Let’s take a look how we would cover these scenarios.

Read More