yozamacs / go-workshop

Go workshop source code for Tech Intersections conference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go workshop - Tech Intersections 2018

Purpose

The purpose of this workshop is to experiment with a simple go project and learn how to cross compile go

Get started

Install and Set Up Go

  • Download the appropiate go binary for your operating system here
  • Set up your GOPATH like this
  • Create go directory, mkdir $GOPATH
  • Create the following directories underneath your GOPATH
    • mkdir $GOPATH/src
    • mkdir $GOPATH/bin
    • mkdir $GOPATH/pkg

Get the project set up

  • Run go get -u github.com/yozamacs/go-workshop to get this code
  • Navigate to the above path and open up in your favorite code editor and play around!

Build project

  • From the project directory run go build .
  • This will create an executable in the project directory
  • Run the executable with the command ./go-workshop
    • You can run the executable with various options including
      • -image_location=<any png,jpg/jpeg,gif image link>
      • -filter_list=<one or more of the following: grayscale,invert,pixelate>
    • Example command line opttions
      • ./go-workshop -image_location=https://i.imgur.com/FB5IGMg.png
      • ./go-workshop -filter_list=pixelate,invert
      • ./go-workshop -image_location=https://i.imgur.com/5JWde5K.jpg -filter_list=pixelate
  • Open a browser and visit http://localhost:8080/image to see the result!

Ideas for tinkering

  • Try it! Add more filters, see the options here
  • Try it! Add a command line option that lists possible filters for users
  • Try it! Try loading the image from a file instead of a link, hint

Miscellaneous

Fun Image Links

Ideas for expanding the workshop

  • Creating a way for the app to take requests to make it an easy backend for a front end framework
  • Using the imaging library to combine various pictures into one picture
  • Find a library that does facial recognition to get more control over filters

About

Go workshop source code for Tech Intersections conference


Languages

Language:Go 100.0%