Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/mrojasb2000/hands-on-full-stack-development-with-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mrojasb2000/hands-on-full-stack-development-with-go

  • v0.0.0-20200326020632-202e632b61ad
  • Source
  • Go
  • Socket score

Version published
Created
Source

hands-on-full-stack-development-with-go

Hands-On Full Stack Development with Go

Preface

The Go programming language has been rapidy adopted by developers for building web applications. With its impressive performance and ease of development,

Chapter 2, h3. Go's Building Blocks.

For you to write Go code on your computer, you need to set up a Go workspace. A Go workspace is a folder where you will write your Go code. Setting up a Go workspace is relatively simple.

1.- First, make sure that you have Go installed. As we mentioned earlier, you can download and install Go site http://golang.org

2.- After installing Go, create a new folder in your computer for Go's workspace. Mine is called GoProjects.

3.- Inside your Go workspace folder, you will have to create three main folders: src, pkg, bin. It is very important to create folders with these exact names inside your Go workspace folder.

  • The src folder will host all of your code files.
  • The pkg folder typically hosts the compiled package files of your code.
  • The bin folder typically hosts the binary files that are produced by your Go programs.

4.- You will need to set two environment variables:

  • The first enviroment variable is called GoRoot, and will include the path to your Go install. GoRoot should tipically be taken care of by the Go installer. Howwever, if it's missing, or you would like to move your Go installation to a different place, then you need to set GoRoot.

  • The second environment variable is called GoPath. GoPath includes the path to your Go workspace folder. By default, if not set, GoPath is assumed to either to be as $HOME/go on Unix systems or %USERPROFILE%\go Windows.

5.- Create folder $GoPath/example $ mkdir -p $GoPath/example

6.- Create file main.go in $GoPath/example $ touch $GoPath/example/main.go

7.- Edit Go file and add basic code Go.

package main

import "fmt"

func main() { fmt.Println("Hello World!") }

8.- To compile a Go program, you will need to navigate to the folder where your main package lives and the type the following command:

$ cd $GoPath/example $ go install

This command will compile your Go program and then place the resulting binary in the bin folder of youe workspace.

Alternatively, you can run the following command: $ cd $GoPath/example $ go build

This command will compile and then deploy the resulting binary in the current folder.

Chapter 3, h3. Go Concurrency

Chapter 4, h3. Frontend with React.js

Chapter 5, h3. Building a Frontend for GoMusic

Chapter 6, h3. RESTful Web APIs in Go with the Gin

Chapter 7, h3. Advanced Web Go Applications with Gin and React

Chapter 8, h3. Testing and Benchmarking Your Web API

Chapter 9, h3. Introduction to Isomorphic Go with GopherJS

Chapter 10, h3. Where to Go from here?

FAQs

Package last updated on 26 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc