Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Tue, 23 Apr 2019 05:54:00 +0000 Generis, a Go preprocessor for generics, free-form macros and HTML templating <p>Just to inform you that I’ve just released a first version of <b>Generis</b>, a lightweight code preprocessor adding the following features to the Go language :</p> <ul> <li>Generics.</li> <li>Free-form macros.</li> <li>Conditional compilation.</li> <li>HTML templating.</li> <li>Allman style conversion.</li> </ul><div><a href="https://github.com/senselogic/GENERIS">https://github.com/senselogic/GENERIS</a><b><br></b></div><div><br></div><div>It’s similar in function to both Ego and Genny, but implemented as a free-form C++ like preprocessor... </div><div><b><br></b></div><div><b>Sample code :</b><br></div><div><pre><span class="pl-k">package main; <span class="pl-c"><span class="pl-c">// -- IMPORTS <span class="pl-k">import ( <span class="pl-s"><span class="pl-pds">"html<span class="pl-pds">" <span class="pl-s"><span class="pl-pds">"io<span class="pl-pds">" <span class="pl-s"><span class="pl-pds">"log<span class="pl-pds">" <span class="pl-s"><span class="pl-pds">"net/http<span class="pl-pds">" <span class="pl-s"><span class="pl-pds">"strconv<span class="pl-pds">" ); <span class="pl-c"><span class="pl-c">// -- DEFINITIONS #define <span class="pl-v">DebugMode #as <span class="pl-c1">true <span class="pl-c"><span class="pl-c">// ~~ #define <span class="pl-v">HttpPort #as <span class="pl-c1">8080 <span class="pl-c"><span class="pl-c">// ~~ #define <span class="pl-v">WriteLine( {{text}} ) #as log.<span class="pl-c1">Println( {{text}} ) <span class="pl-c"><span class="pl-c">// ~~ #define local {{variable}} : {{<span class="pl-k">type}}; #as <span class="pl-k">var {{variable}} {{<span class="pl-k">type}}; <span class="pl-c"><span class="pl-c">// ~~ #define <span class="pl-v">DeclareStack( {{<span class="pl-k">type}}, {{name}} ) #as <span class="pl-c"><span class="pl-c">// -- TYPES <span class="pl-k">type {{name}}Stack <span class="pl-k">struct { <span class="pl-v">ElementArray []{{<span class="pl-k">type}}; } <span class="pl-c"><span class="pl-c">// -- INQUIRIES <span class="pl-c1">func ( stack * {{name}}Stack ) <span class="pl-c1">IsEmpty( ) <span class="pl-k">bool { <span class="pl-k">return <span class="pl-c1">len( stack.<span class="pl-smi">ElementArray ) == <span class="pl-c1">0; } <span class="pl-c"><span class="pl-c">// -- OPERATIONS <span class="pl-c1">func ( stack * {{name}}Stack ) <span class="pl-c1">Push( element {{<span class="pl-k">type}} ) { stack.<span class="pl-smi">ElementArray = <span class="pl-c1">append( stack.<span class="pl-smi">ElementArray, element ); } <span class="pl-c"><span class="pl-c">// ~~ <span class="pl-c1">func ( stack * {{name}}Stack ) <span class="pl-c1">Pop( ) {{<span class="pl-k">type}} { local element : {{<span class="pl-k">type}}; element = stack.<span class="pl-smi">ElementArray[ <span class="pl-c1">len( stack.<span class="pl-smi">ElementArray ) - <span class="pl-c1">1 ]; stack.<span class="pl-smi">ElementArray = stack.<span class="pl-smi">ElementArray[ : <span class="pl-c1">len( stack.<span class="pl-smi">ElementArray ) - <span class="pl-c1">1 ]; <span class="pl-k">return element; } #end <span class="pl-c"><span class="pl-c">// ~~ #define <span class="pl-v">DeclareStack( {{<span class="pl-k">type}} ) #as <span class="pl-v">DeclareStack( {{<span class="pl-k">type}}, {{<span class="pl-k">type:PascalCase}} ) <span class="pl-c"><span class="pl-c">// -- TYPES <span class="pl-c1">DeclareStack( <span class="pl-k">string ) <span class="pl-c1">DeclareStack( <span class="pl-k">int32 ) <span class="pl-c"><span class="pl-c">// -- FUNCTIONS <span class="pl-k">func <span class="pl-v">HandleRootPage( response_writer http.<span class="pl-smi">ResponseWriter, request * http.<span class="pl-smi">Request ) { local boolean : <span class="pl-k">bool; local natural : <span class="pl-k">uint; local integer : <span class="pl-k">int; local real : <span class="pl-k">float64; local escaped_text, text : <span class="pl-k">string; local integer_stack : <span class="pl-v">Int32Stack; boolean = <span class="pl-c1">true; natural = <span class="pl-c1">10; integer = <span class="pl-c1">20; real = <span class="pl-c1">30.0; text = <span class="pl-s"><span class="pl-pds">"text<span class="pl-pds">"; escaped_text = <span class="pl-s"><span class="pl-pds">"&lt;escaped text/&gt;<span class="pl-pds">"; integer_stack.<span class="pl-c1">Push( <span class="pl-c1">10 ); integer_stack.<span class="pl-c1">Push( <span class="pl-c1">20 ); integer_stack.<span class="pl-c1">Push( <span class="pl-c1">30 ); #write response_writer &lt;!DOCTYPE html&gt; &lt;html lang=<span class="pl-s"><span class="pl-pds">"en<span class="pl-pds">"&gt; &lt;head&gt; &lt;meta charset=<span class="pl-s"><span class="pl-pds">"utf-8<span class="pl-pds">"&gt; &lt;title&gt;&lt;%= request.<span class="pl-smi">URL.<span class="pl-smi">Path %&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;% <span class="pl-k">if ( boolean ) { %&gt; &lt;%= <span class="pl-s"><span class="pl-pds">"URL : <span class="pl-pds">" + request.<span class="pl-smi">URL.<span class="pl-smi">Path %&gt; &lt;br/&gt; &lt;%@ natural %&gt; &lt;%# integer %&gt; &lt;%&amp; real %&gt; &lt;br/&gt; &lt;%~ text %&gt; &lt;%= escaped_text %&gt; &lt;%= <span class="pl-s"><span class="pl-pds">"&lt;<span class="pl-c1">%% ignored <span class="pl-c1">%%&gt;<span class="pl-pds">" %&gt; &lt;%% ignored %%&gt; &lt;% } %&gt; &lt;br/&gt; <span class="pl-v">Stack : &lt;br/&gt; &lt;% <span class="pl-k">for !integer_stack.<span class="pl-c1">IsEmpty() { %&gt; &lt;%# integer_stack.<span class="pl-c1">Pop() %&gt; &lt;% } %&gt; &lt;/body&gt; &lt;/html&gt; #end } <span class="pl-c"><span class="pl-c">// ~~ <span class="pl-k">func <span class="pl-en">main() { http.<span class="pl-c1">HandleFunc( <span class="pl-s"><span class="pl-pds">"/<span class="pl-pds">", HandleRootPage ); #<span class="pl-k">if DebugMode <span class="pl-c1">WriteLine( <span class="pl-s"><span class="pl-pds">"Listening on http://localhost:HttpPort<span class="pl-pds">" ); #end log.<span class="pl-c1">Fatal( http.<span class="pl-c1">ListenAndServe( <span class="pl-s"><span class="pl-pds">":HttpPort<span class="pl-pds">", <span class="pl-c1">nil ) ); }</pre></div> 4 points posted by Ecstatic Coder https://github.com/senselogic/GENERIS 3935 Sun, 21 Apr 2019 11:34:00 +0000 minikeyvalue - A distributed key value store in under 200 lines 4 points posted by lolly https://github.com/geohot/minikeyvalue 3933 Sat, 20 Apr 2019 19:29:00 +0000 ledrace - TinyGo implementation of Open LED Race 5 points posted by lolly https://github.com/conejoninja/ledrace 3930 Fri, 19 Apr 2019 21:44:00 +0000 timeliner - all your digital life on a single timeline, stored locally <p>Timeliner is a personal data aggregation utility. It collects all your digital things from pretty much anywhere and stores them on your own computer, indexes them, and projects them onto a single, unified timeline.</p> <p>The intended purpose of this tool is to help preserve personal and family history.</p> 4 points posted by kenny https://github.com/mholt/timeliner 3931 Sat, 20 Apr 2019 10:09:00 +0000 pacgo - A Pac Man clone written in Go (with emojis!) 8 points posted by kenny https://github.com/danicat/pacgo 3911 Fri, 12 Apr 2019 07:52:00 +0000 crdt - a Go implementation of CRDTs <p>This is an implementation of <a href="https://hal.inria.fr/inria-00555588/document" rel="nofollow">Convergent and Commutative Replicated Data Types</a>&nbsp;in <a href="https://golang.org/" rel="nofollow">Go</a>.</p> 5 points posted by kenny https://github.com/neurodrone/crdt 3921 Mon, 15 Apr 2019 16:30:00 +0000 Go Best Practices at Joyent by Sean Chittenden This is now abandoned and contains some defunct references (GOPATH for example), but is of historical interest I think.&nbsp; 13 points posted by kenny https://github.com/joyent/rfd/blob/master/rfd/0106/README.adoc 3870 Sat, 23 Mar 2019 17:08:00 +0000 Examples of Golang compared to Node.js for learning #nodejs 4 points posted by lolly https://github.com/miguelmota/golang-for-nodejs-developers 3912 Fri, 12 Apr 2019 17:09:00 +0000 sqlrows - Go static code analyzer which helps uncover bugs of database/sql.Rows. 6 points posted by timakin https://github.com/gostaticanalysis/sqlrows 3892 Wed, 03 Apr 2019 15:54:00 +0000 vcheck - GRPC/HTTP deployment build version check When deploying service with Gitlab or Travis etc. during deployment step you may want to check if your GRPC/HTTP service actually deployed successfully by calling it's endpoint and checking if build version matches. 4 points posted by anjmao https://github.com/anjmao/vcheck 3906 Wed, 10 Apr 2019 06:47:00 +0000 popeye - 🧭 A Kubernetes cluster resource sanitizer 4 points posted by Everton Marques https://github.com/derailed/popeye 3903 Mon, 08 Apr 2019 18:14:00 +0000 ko - Build and deploy Go applications on Kubernetes 8 points posted by lolly https://github.com/google/ko 3861 Fri, 22 Mar 2019 14:22:00 +0000 go2proto - Generate protobuf messages from go structs go2proto is a simply cmd util which allows to convert go structs into protobuf messages. It's differs from <a href="https://github.com/src-d/proteus">https://github.com/src-d/proteus</a>&nbsp;as being much simpler and doesn't generate RPC services etc. and most importantly it works with go modules. 3 points posted by anjmao https://github.com/anjmao/go2proto 3910 Fri, 12 Apr 2019 06:47:00 +0000 qri - a distributed version control system You're invited to a data party! A global dataset version control system (GDVCS) built on the distributed web<br> 6 points posted by gopher https://github.com/qri-io/qri 3868 Sat, 23 Mar 2019 14:04:00 +0000 Fathom. Simple, trustworthy website analytics. Built with Go & Preact This is also available on the digital ocean marketplace.&nbsp; 6 points posted by kenny https://github.com/usefathom/fathom 3848 Sat, 16 Mar 2019 18:58:00 +0000 go-arg - Struct-based argument parsing in Go 4 points posted by Everton Marques https://github.com/alexflint/go-arg 3887 Mon, 01 Apr 2019 16:41:00 +0000 gwob - Go parser for Wavefront .OBJ 3D geometry file format #graphics 4 points posted by Everton Marques https://github.com/udhos/gwob 3878 Wed, 27 Mar 2019 16:58:00 +0000 bodyclose - Analyzer: checks whether HTTP response body is closed. 4 points posted by timakin https://github.com/timakin/bodyclose 3876 Wed, 27 Mar 2019 06:05:00 +0000 goweight - A tool to analyze and troubleshoot a Go binary size. 3 points posted by Everton Marques https://github.com/jondot/goweight 3894 Thu, 04 Apr 2019 22:06:00 +0000 vugu - Vugu: A modern UI library for Go+WebAssembly (experimental) If you've ever wanted to write a UI not in JS but pure Go... and run it in your browser, right now... That (experimental;) future is here! 3 points posted by Justin Clift https://github.com/vugu/vugu 3891 Wed, 03 Apr 2019 11:21:00 +0000 go-echarts: 🎨The adorable charts library for Golang <a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/19553554/52535979-c0d0e680-2d8f-11e9-85c8-2e9f659e7c6f.png"><img src="https://user-images.githubusercontent.com/19553554/52535979-c0d0e680-2d8f-11e9-85c8-2e9f659e7c6f.png" width="300" height="300"></a>&nbsp; 6 points posted by kenny https://github.com/chenjiandongx/go-echarts 3840 Thu, 14 Mar 2019 00:03:00 +0000 A Distributed Key/Value store using Raft for concensus with a Redis compatible API <p>A <a href="https://github.com/prologic/bitcask">Bitcask</a>&nbsp;Distributed Key/Value store using <a href="https://github.com/hashicorp/raft">Raft</a>&nbsp;for concensus with a <a href="https://redis.org/" rel="nofollow">Redis</a>&nbsp;compatible API written in <a href="https://golang.org/" rel="nofollow">Go</a>.</p> <p>Based off of <a href="https://github.com/tidwall/kvnode">kvnode</a>. (See <a href="https://github.com/prologic/bitraft/blob/master/LICENSE.old">LICENSE.old</a>)</p> <ul><li>Redis compatible API</li> <li>Bitcask disk-based storage</li> <li>Raft support with <a href="https://github.com/tidwall/finn">Finn</a>&nbsp;commands</li> <li>Compatible with existing Redis clients</li> </ul> 5 points posted by James Mills https://github.com/prologic/bitraft 3858 Thu, 21 Mar 2019 20:42:00 +0000 instagraph - Social graph network of your Instagram account. 5 points posted by AhmadrezaZibaei https://github.com/ahmdrz/instagraph 3827 Tue, 05 Mar 2019 07:33:00 +0000 GitHub - janelia-flyem/dvid: Distributed, Versioned, Image-oriented Dataservice Distributed, Versioned, Image-oriented Dataservice - janelia-flyem/dvid 4 points posted by kenny https://github.com/janelia-flyem/dvid 3869 Sat, 23 Mar 2019 14:57:00 +0000 crfs - Container Registry Filesystem #crfs <strong>CRFS</strong>&nbsp;is a read-only FUSE filesystem that lets you mount a container image, served directly from a container registry (such as <a href="https://gcr.io/" rel="nofollow">gcr.io</a>), without pulling it all locally first. 4 points posted by kenny https://github.com/google/crfs 3865 Sat, 23 Mar 2019 07:56:00 +0000 Fyne: an easy to use UI toolkit and app API written in Go with OpenGL <p><a href="http://fyne.io/" rel="nofollow">Fyne</a>&nbsp;is an easy to use UI toolkit and app API written in Go. We use OpenGL (through the go-gl and go-glfw projects) to provide cross platform graphics.</p><div><br></div> 4 points posted by mastabadtomm https://github.com/fyne-io/fyne 3857 Thu, 21 Mar 2019 19:01:00 +0000 wesher - wireguard overlay mesh network manager 3 points posted by Leo Antunes https://github.com/costela/wesher 3885 Thu, 28 Mar 2019 22:59:00 +0000 Octopus - Redis Multi-Cluster load balancing using prefix 3 points posted by Amir https://github.com/quizofkings/octopus 3863 Fri, 22 Mar 2019 20:38:00 +0000 simpletoken - generating HMAC tokens 1 points posted by AhmadrezaZibaei https://github.com/ahmdrz/simpletoken 3922 Tue, 16 Apr 2019 07:52:00 +0000 Moving from Go 1 to Go 2 13 points posted by kenny https://github.com/golang/proposal/blob/master/design/28221-go2-transitions.md 3624 Wed, 24 Oct 2018 08:59:00 +0000 Gocity - see code as 3d cities 11 points posted by drogo https://go-city.github.io/#/github.com/rodrigo-brito/gocity 3640 Sun, 04 Nov 2018 13:56:00 +0000 Show: Dataflow Kit - extract structured data from web sites. Web sites scraping.   11 points posted by slotix https://github.com/slotix/dataflowkit 3501 Mon, 13 Aug 2018 19:44:00 +0000 Fo: An experimental language which adds generics to Go 10 points posted by saml https://github.com/albrow/fo 3389 Fri, 15 Jun 2018 13:50:00 +0000 tinygo - a Go compiler for small devices, based on LLVM 9 points posted by kenny https://github.com/aykevl/tinygo 3622 Tue, 23 Oct 2018 14:54:00 +0000 survey - a go library for building interactive prompts survey - a go library for building interactive prompts with full support for windows and posix terminals. 8 points posted by kenny https://github.com/AlecAivazis/survey 3637 Fri, 02 Nov 2018 19:31:00 +0000 A Go Custom Flutter Engine Embedder for desktop 7 points posted by kenny https://github.com/Drakirus/go-flutter-desktop-embedder 3775 Fri, 18 Jan 2019 13:53:00 +0000 go-t - A fast, simple and easy to use command-line client for Twitter written in Go. 🚀📨 7 points posted by cbrgm https://github.com/cbrgm/go-t 3750 Sun, 30 Dec 2018 20:41:00 +0000 strife - a 2d game framework in Go 7 points posted by kenny https://github.com/felixangell/strife 3588 Sat, 29 Sep 2018 18:40:00 +0000 Show: Qamel, QML binding for Go 6 points posted by acrophobic https://github.com/RadhiFadlillah/qamel 3761 Tue, 08 Jan 2019 01:29:00 +0000 autopprof - pprof made easy at development time for Go 6 points posted by kenny https://github.com/rakyll/autopprof 3683 Thu, 22 Nov 2018 05:54:00 +0000 golua - A Lua 5.3 engine implemented in Go 6 points posted by kenny https://github.com/Azure/golua 3668 Fri, 16 Nov 2018 16:21:00 +0000 stellar - a simplified container runtime cluster <p>Stellar is designed to provide simple container runtime clustering. One or more nodes are joined together to create a cluster. The cluster is eventually consistent making it ideal for transient workloads or edge computing where nodes are not always guaranteed to have high bandwidth, low latency connectivity.<br></p> 6 points posted by kenny https://github.com/ehazlett/stellar 3643 Tue, 06 Nov 2018 00:22:00 +0000 BadgerDB engine for Blevesearch 6 points posted by Mohammed Al Ashaal https://github.com/alash3al/bbadger 3636 Fri, 02 Nov 2018 15:46:00 +0000 sdns - Lightweight, fast recursive dns server with dnssec support 6 points posted by blanx https://github.com/semihalev/sdns 3634 Thu, 01 Nov 2018 14:14:00 +0000 kocircuit - A generic type-safe language built on Go Ko: A generic type-safe language for concurrent, stateful, deadlock-free systems and protocol manipulations 6 points posted by kenny https://github.com/kocircuit/kocircuit 3582 Tue, 25 Sep 2018 12:30:00 +0000 Twisk - Golang RPC starter kit 5 points posted by dsxack https://github.com/ribice/twisk 3800 Tue, 12 Feb 2019 06:46:00 +0000 go-fuzzyfinder - fzf-like fuzzy-finder as a Go library #fuzzyfinder 5 points posted by ktr https://github.com/ktr0731/go-fuzzyfinder 3797 Sat, 09 Feb 2019 06:38:00 +0000 iv - APL interpreter and stream processor 5 points posted by gopher https://github.com/ktye/iv 3781 Fri, 25 Jan 2019 19:35:00 +0000 SQLer - Turn Your SQL queries into RESTful APIs without any programming language 5 points posted by Mohammed Al Ashaal https://github.com/alash3al/sqler 3762 Tue, 08 Jan 2019 17:28:00 +0000 aminal - a terminal emulator from scratch #cli Aminal is a modern terminal emulator for Mac/Linux implemented in Golang and utilising OpenGL. 5 points posted by tomf https://github.com/liamg/aminal 3694 Wed, 28 Nov 2018 06:38:00 +0000