Giter Site home page Giter Site logo

go_data_workshop's Introduction

Data processing in Go

These are the materials for a CSCAR workshop on using Go for basic data processing, focusing on manipulating text files. No prior exposure to Go is expected, however note that Go may not be the easiest language to start with if you have never programmed before. People familiar with scripting languages such as Python should find most aspects of Go to be fairly straightforward.

Go is a new language that is being adopted by organizations that process large volumes of data. It is also used in data center management and as a back-end language for web applications. We will not try to characterize Go as a language here, or say much about its possible use cases. If you are interested in this topic, you may want to watch these presentations by one of the primary designers of Go: Another Go at language design, Simplicity is complicated.

Installation and setup

The Go project and tools are both open source and community-driven. To compile and run Go code on your computer, you will need to download and install the "Go tool", which can be found here. More detailed installation instructions are here. Alternatively, if you are at UM and are using Flux, type "module load go" at the shell prompt to make the Go tool available.

Go source files can be written in a text editor, or using various IDE's (integrated development environments). There is no official or predominant IDE or editor for Go. This screencast walks through the standard uses of the Go tool.

Compiling and running a simple Go program

Go scripts can be placed anywhere in your file system. Go packages that are able to be used by other Go programs should be placed in your GOHOME directory, which defaults to the directory named "go" in the top level of your home directory, i.e. ~/go.

Go source files are text files with suffix ".go". A very simple Go program is:

package main

import "fmt"

func main() {
    fmt.Printf("A Go program...\n")
}

Suppose you save this in a file called simple.go in your current working directory. You should be able to run it using the command go run simple.go. Alternatively, you can compile it to an executable using go build simple.go, then run the executable using simple.

Difficulties with any of the steps above are likely due to a missing or incomplete installation of the Go tool, or misconfigured environment variables such as PATH.

Resources

The effective go document is a complete overview of the Go language. A somewhat friendlier introduction to the language is the Go tour.

You can experiment with small Go programs in your browser using the playground.

go_data_workshop's People

Contributors

kshedden avatar

Stargazers

gin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.