Category: General Development
Bundle HTML, CSS, And JavaScript To Be Served In A Golang Application
So I’ve been working on a project that uses the Go programming language. The application I’m building is a web application that I plan to distribute. The thing is, I don’t want to distribute hundreds of files to make it possible. The application has an API built with Go and the front-end that consumes the API is built with Angular. This lead me searching for a way to bundle all the files into the final binary.
There are several packages that exist for bundling assets into a Golang application. Popular packages include go-bindata, go-bindata-assetfs, and go.rice. I had the most success with go.rice, so we’re going to explore it in this article.
Read MoreParse 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 MoreUnit 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 MoreDetermine 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 MoreThe 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 MoreAdd 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 MoreInclude 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