background preloader

Go

Facebook Twitter

Why I Don’t Use Go Web Frameworks – Code Zen – Medium. EDIT: There are in fact, as pointed out by Sébastien Pierre, native response and request objects in the httplib module.

Why I Don’t Use Go Web Frameworks – Code Zen – Medium

But they are not commonly used. Frameworks Hide Most Go web frameworks go all the way to abstract the native controller’s signature completely, hiding the http.Response and http.Request away in exchange of ease of use. Admittedly, it will feel like driving a new fast car for a while until it breaks down on you a few miles down the highway and you pop the hood to find something that’s totally unfamiliar with little resource and support than you had anticipated. Of course, you could always peek into the source code, but wouldn’t that defeat the initial purpose of using a framework? Here is a controller’s function in Echo, a popular framework on Github. func hello() echo.HandlerFunc { return func(c echo.Context) error { return c.String(http.StatusOK, "Hello, World! Let’s look at another very popular framework, Beego: Does this look remotely simpler to you? Homepage - beego: simple & powerful Go app framework. A Tour of Go.

A Word from The Beegoist – Richard Kenneth Eng – Medium. Basic Assumptions You have some familiarity with the Go language.

A Word from The Beegoist – Richard Kenneth Eng – Medium

I highly recommend you follow this Go tutorial. You’ve installed Go and Beego on your computer. There are plenty of good online resources to help you here (for example). It’s really quite easy. You have basic knowledge of CSS, HTML, and databases. You have some experience writing software; basic skills are assumed. You will be using your favourite programming editor in conjunction with the command line. These basic assumptions define the target audience for the tutorial.

Creating the Project First, we must create a Beego project. . $ bee new acme The following directory structure will be created: acme....conf....controllers....models....routers....static........css........img........js....tests....views Note that Beego is a MVC framework (Model/View/Controller), which means that your application will be separated into three general sections.

. $ bee run In your browser, go to to see the running application. The Source Code Model View. Create A Simple RESTful API With GoLang. Most modern applications have separation between the backend and the frontend layers.

Create A Simple RESTful API With GoLang

The backend is typically a RESTful API and is critical part of full stack development. These APIs are generally further broken down into a collection of routes, often referred to as endpoints. Building applications like this is often very clean and maintainable in comparison to mashing everything into a single application. I have been creating RESTful APIs with a variety of programming languages, for example Node.js and Java, but lately I’ve been doing a lot of research on the Go programming language. It is fast and very solid programming language that every seems to be talking about. Google I/O 2014 CodeLab. How to Write Go Code - The Go Programming Language. Introduction ¶ This document demonstrates the development of a simple Go package and introduces the go tool, the standard way to fetch, build, and install Go packages and commands.

How to Write Go Code - The Go Programming Language

The Go Programming Language. Quick web app with Go, Ember.js, and MongoDB. As part of my recent foray into the Go language, I stumbled across this excellent example by Nerdyworm part 1, part 2, part 3 that shows how to build a small web application using the ember.js javascript framework and Go providing the backend server.

Quick web app with Go, Ember.js, and MongoDB

I took this example, fixed up some incompatibilites with the latest version of ember-data.js, and added support for a backing store using MongoDB. You can find all the code for this at my github, while I describe some of the more interesting stuff below. 1 Getting started. Building a REST Service with Golang - Part 1 (Setup) Intro Golang is pretty hot right now.

Building a REST Service with Golang - Part 1 (Setup)

Over the past few weeks, I've been exploring implementing some of the cloud infrastracture I'd previously built with node in go, partly for fun, partly because go is fast. This led me to believe that setting up a basic REST service would make for a great tutorial. At the end, we will have a fully functioning REST service for serving basic CRUD on a user resource. Learn to build and deploy simple Go Web Apps, Part One. In this 4-part series of tutorials, I’m going to take you through the process of creating a fully functioning Go web app called GoView, using just pure Go and deploy to Google App Engine.

Learn to build and deploy simple Go Web Apps, Part One

Hopefully, this will help to demonstrate just how quick and easy it is to use Go for web apps. Let’s begin with the basics. Assumption I am assuming that you have downloaded and installed Go and have set the GOPATH properly. If new to Go, then my previous article has this covered. Google App Engine Google App Engine is different from most other cloud systems because it is neither IaaS (Infrastructure-as-a-Service, e.g., Amazon EC2) nor SaaS (Software-as-a-Service, e.g., Salesforce).