Questions tagged [go]

Go, commonly referred to as "golang", is a fast, statically typed, compiled language created by Google. The language was initially developed as an alternative to C++ for server infrastructure and has native support for concurrency.

Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Natural mergesort

This is a problem from Robert Sedgwick's Algorithms book: Write a version of bottom-up mergesort that takes advantage of order in the array by proceeding as follows each time it needs to find two ...
3
votes
0answers
87 views

Writing Go object code that respects Go guidelines

I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be: Am I using the ...
1
vote
1answer
58 views

Simulating pod racing over a 2D map : am I implementing OOP in a GO-like fashion?

I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be. I used an OOP design. Is it correctly implemented ...
9
votes
2answers
6k views

Fibonacci generator with Golang

This is my Fibonacci generator: package main import "fmt" func main() { for i, j := 0, 1; j < 100; i, j = i+j,i { fmt.Println(i) } } It's ...
16
votes
1answer
1k views

Go Fish game written in Go

A couple months back I made a go fish game in Go, just for the sake of that pun. It was pretty poorly done and made experienced Go-ers cry when they looked at it. I rewrote some of it to be more ...
1
vote
1answer
167 views

Redis Client: Go based Game server

Here is my Go code to interact with a Redis server ...
7
votes
3answers
2k views

Selection sort algorithm with increasing/decreasing sort options

I am running through some traditional algorithms in Go, and I was hoping to get feedback on efficiency and optimization. Below is a basic selection sort algorithm that takes a parameter to dictate ...
2
votes
1answer
93 views

Finding all prime numbers within a range

I am trying to find all primes less than 2,000,000 and sum them together. My code currently takes 1'36" to run. Is there a faster way to get my solution? The logic I am following in this code is make ...
1
vote
0answers
156 views

Multi Site Concurrent web crawler using gRPC

This is the server portion of a gRPC implementation of a multi site concurrent web crawler. ...
6
votes
1answer
874 views

Alternate letters to UpperCase

As an exercise I repeated this Java question, but in Go: Convert string to mixed case The objective is for every second letter to be converted to uppercase. Go string processing is relatively new to ...
3
votes
2answers
323 views

Generate thousands of JSON documents in Go

I recently decided to try to learn the Go language. In order to do this, I wrote a small program which parses a JSON configuration file, and generates N bson documents according to its properties. ...
2
votes
1answer
114 views

Gin framework project with an endpoint to return a list of users based on their score

My relevant work experience is with Java (mostly web development with Dropwizard/Spring) so I can not avoid using the same practices as I do in a Java project. The project is there but I am going to ...