https://github.com/james-see/go-examples
go get github.com/jamesacampbell/go-examples WIP!
https://github.com/james-see/go-examples
example example-project golang tutorial
Last synced: 5 months ago
JSON representation
go get github.com/jamesacampbell/go-examples WIP!
- Host: GitHub
- URL: https://github.com/james-see/go-examples
- Owner: james-see
- License: mit
- Created: 2018-12-01T04:59:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-10T21:26:31.000Z (almost 7 years ago)
- Last Synced: 2024-10-12T00:32:42.642Z (over 1 year ago)
- Topics: example, example-project, golang, tutorial
- Language: Go
- Homepage:
- Size: 20.7 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-examples
## Install
go get github.com/jamesacampbell/go-examples
## TL;DR;
cd to the directory and run: `go run main.go [instagram username]` and it will run each example
## What
Examples of libraries I use in golang frequently as a way for me to remember and hopefully useful for others making their way. Go get 'em. ;)
## 1 REDIS
The code is in redis1 folder, but just run main.go from root and it will run this along with the other examples. _You must have redis installed locally for this to work._
It should print `PONG` to show it is connected.
## 2 HTTP SERVER
The code is in the httpserver2 folder, it also runs from the root main.go file just fine and server Hello World to 127.0.0.1:1337 because you are a N00B. ;)
## 3 HEADLESS CHROME SCRAPER
The code is in the headless3 folder, it runs from main.go and asks you for an instagram profile to load. Instagram notoriously doesn't load if javascript is not available, thus a good test for headless chrome. It takes a instagram-profile.png to the root folder. *It only works in OSX / Mac OS* and if you have [Google Chrome](https://www.google.com/chrome/) installed already.
## 4 ENTITY EXTRACTOR USING PROSE
[Prose]("gopkg.in/jdkato/prose.v2") is pretty neat. It pulls out People, Places, and other things right out of the box. I tested it on English text and it seems to do pretty well. This example takes the text scraped from number 3 and throws it through Prose.