Go Community Linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Go community here or just enjoy what everyone else has found!


A no-go fantasy: writing Go in Ruby with Ruby Next

On the Martian blog, Svyatoslav Kryukov enters into a fantasy realm, and is forced to imagine that ✨everything must be written in Go!✨

Read and learn to write Go in Ruby, gaining the ability to modify Ruby exactly as you desire.

In this article, he covers:

  • Replicating Go’s functionality in Ruby.
  • Modifying a lexer and parser – then creating your own!
  • Adding a rewriter with the help of Ruby Next.
  • Plus, other cool techniques to bring everything to life!

👉 Read the tale: https://evilmartians.com/chronicles/a-no-go-fantasy-writing-go-in-ruby-with-ruby-next

 

ClassiBuy A Perfect Letgo Clone Script for Just $499USD

We are glad to launch our Classibuy- a letgo clone script wrapped with an exclusive launch offer of mobile apps and an admin panel for 499$.

Features of Letgo clone script

Multiple sign-up and sign-in via social account. Geo-based search for ads. Detailed product view page. Featured ads to promote and highlight listings. Instant chat option to connect with the seller. Multiple categories to find listings with ease. Ratings and Reviews to post user’s feedbacks. Banners campaigns to spotlight ads. Buy now for instant product checkout. Multiple languages and currencies for global users. Admin dashboard to control the entire website. Push notifications to update users promptly.

Our script is boundless to the above-mentioned features. The platform is highly reliable to scale any of your innovative customization work to incorporate future methodologies.

Pertaining to technologies, Our Letgo clone script is developed with the most efficient Flutter app technology, Which adds superiority as flutter is highly reliable to design eye-catching UI layouts with customizable design and widgets. Classibuy solves the challenges of aspiring entrepreneurs to establish an online classifieds platform smoothly into the digital market.

About MindLeef MindLeef is an eCommerce solution provider and software development company. The objective of MindLeef is to render customer-centric solutions for entrepreneurs to meet their expectations to launch a buy and sell marketplace hassle-free. Their mission is to sync with the trend to unleash the potential of technology into remarkable solutions.

Contact Information Phone - +919042203928 Email - info@mindleef.com Website - https://mindleef.com/letgo-clone

 

An Introduction to Go Debugging with Delve

Great video on Delve & Go, Delve is a popular feature-rich debugger for Go. 22 minutes

Go Debugging with Delve

 Brian Scott

Goapp - An opinionated guideline to structure & develop a Go web application/service

Goapp is an opinionated guideline to structure a Go web application/service (or could be extended for any application). These opinions were formed over a span of 5+ years building web applications/services with Go, trying to implement DDD (Domain Driven Development) & Clean Architecture. Even though I've mentioned go.mod and go.sum, this guideline works for 1.4+ (i.e. since introduction of the special 'internal' directory).

 Kamaleshwar

Embarquer des templates avec pkger (fr_FR)

Tant que Go est encore en version 1.15.x et n'a pas encore les embeds de fichier en standard, voici comment utiliser pkger pour embarquer vos templates ou tout autre asset:

https://osinet.fr/go/articles/inclusion-de-templates-avec-pkger/

 Frédéric G. MARAND

Bundling templates with pkger

While Go is still 1.15.x and doesn't yet have standard embeds, here is how to embed templates (or whatever assets you need) in your code with pkger.

https://osinet.fr/go/en/articles/bundling-templates-with-pkger/

 Frédéric G. MARAND

Go: comandos CLI, parte 2 (pt_BR)

Parte 2 de 3 onde esclareço o funcionamento dos comandos presentes na ferramenta CLI go.

http://devdrops.me/posts/go-comandos-cli-parte-2/

 Davi Marcondes Moreira

Go: comandos CLI, parte 1 (pt_BR)

Parte 1 de 3 onde esclareço o funcionamento dos comandos presentes na ferramenta CLI go.

http://devdrops.me/posts/go-comandos-cli-parte-1/

 Davi Marcondes Moreira

Import Cycles in Golang and How to Deal with them

As a Golang developer, you probably have encountered import cycles. Golang do not allow import cycles. Go throws a compile-time error if it detects the import cycle in code. In this post, let’s understand how the import cycle occurs and how you can deal with them.

Find full blog here:

https://jogendra.dev/import-cycles-in-golang-and-how-to-deal-with-them

 Jogendra

Web Development in Go: Middleware, Templating, Databases & Beyond

This is the next installment of our series by Ayooluwa Isaiah that explains features in Go so developers can compare them to Ruby or whatever other language.

In the previous article in this series, we had an extensive discussion on the Go net/http package and how it can be used for production-ready web applications. We focused mostly on the routing aspect and other quirks and features of the http.ServeMux type.

This article will close out the discussion on ServeMux by demonstrating how middleware functions can be implemented with the default router and introducing other standard library packages that are sure to come in handy when developing web services with Go. https://www.honeybadger.io/blog/ruby-to-go-4/

 Ben Findley

Faker: random fake data and struct generator for Go. #faker @pioz

Random fake data and struct generator for Go.

https://github.com/pioz/faker

  • More than 100 generator functions
  • Struct generator
  • Unique data generator
  • Builtin types support
  • Easily customizable
  • Zero dependencies
  • Recursive infinite loop detector
  • Benchmarks (coming soon)

Struct Builder Example

faker.SetSeed(622)

// Define a new builder
colorBuilder := func(params ...string) (interface{}, error) {
  return faker.Pick("Red", "Yellow", "Blue", "Black", "White"), nil
}

// Register a new builder named "color" for string type
err := faker.RegisterBuilder("color", "string", colorBuilder)
if err != nil {
  panic(err)
}

type Animal struct {
  Name  string `faker:"username"`
  Color string `faker:"color"` // Use custom color builder
}

type Person struct {
  FirstName string            `faker:"firstName"`         // Any available function case insensitive
  LastName  *string           `faker:"lastName"`          // Pointer are also supported
  Age       int               `faker:"intinrange(0,120)"` // Can call with parameters
  UUID      string            `faker:"uuid;unique"`       // Guarantees a unique value
  Number    int               `faker:"-"`                 // Skip this field
  Code      string            // No tag to use default builder for this field type
  Pet       Animal            // Recursively fill this struct
  Nicknames []string          `faker:"username;len=3"`          // Build an array of size 3 using faker.Username function
  Extra     map[string]string `faker:"stringWithSize(3);len=2"` // map are supported
}

p := Person{}
err = faker.Build(&p)
if err != nil {
  panic(err)
}
fmt.Println(p.FirstName)
fmt.Println(*p.LastName)
fmt.Println(p.Age)
fmt.Println(p.UUID)
fmt.Println(p.Number)
fmt.Println(p.Code)
fmt.Println(p.Pet.Name)
fmt.Println(p.Pet.Color)
fmt.Println(len(p.Nicknames))
fmt.Println(p.Nicknames[0])
fmt.Println(p.Nicknames[1])
fmt.Println(p.Nicknames[2])
fmt.Println(p.Extra)
// Output: Wilber
// Gutkowski
// 25
// ff8d6917-b920-46e6-b1be-dc2d48becfcb
// 0
// z
// honegger
// Red
// 3
// teagan
// polypeptide
// chinfest
// map[70w:3F6 gQS:isq]

Factory

One of the nice things about Faker is that it can also be used as a factory library. In fact when we call the faker.Build function if a value is not zero then it is not modified, leaving the original value. This allows you to create factory functions very easily:

faker.SetSeed(623)

type User struct {
    Username string `faker:"username"`
    Email    string `faker:"email"`
    Country  string `faker:"CountryAlpha2"`
}

italianUserFactory := func() *User {
    u := &User{Country: "IT"}
    faker.Build(u)
    return u
}

italianUser := italianUserFactory()
fmt.Println(italianUser)
// Output: &{spicule hoag@ornamented.biz IT}
 Enrico

A Gentle Introduction to Web Services With Go

When you're deciding on a technology to use for your project, it helps to have a broad understanding of your options. You may be tempted to build a web service in Go for performance reasons - but what would that code actually look like? How would it compare to languages like Ruby or JS? In this article, Ayooluwa Isaiah gives us a guided tour through the building blocks of go web services so you'll be well-informed. https://www.honeybadger.io/blog/go-web-services/

 Ben Findley

Evaluating Go's Package Management and Module Systems

When you're evaluating a language for your next project, few things are more important than available third-party libraries and the package manager that ties them together. While early versions of Go lacked a package manager, they've made up for lost time. In this article, Ayooluwa Isaiah introduces us to Go's module ecosystem to help us decide if Go is "a go" for our next project. https://www.honeybadger.io/blog/golang-go-package-management/

 Ben Findley

Why Rubyists Should Consider Learning Go

These days fewer and fewer web developers get to specialize in a single language like Ruby. We use different tools for different jobs. In this article, Ayooluwa Isaiah argues that Go is the perfect complement to Ruby. The developer who knows both is in a great position to handle almost any back-end challenge. https://www.honeybadger.io/blog/rubyist-learn-go/

 Ben Findley

Debugging Go Applications using Delve

 

Logging in Go: Choosing a System and Using it

Go has built-in features to make it easier for programmers to implement logging. Third parties have also built additional tools to make logging easier. What's the difference between them? Which should you choose? In this article Ayooluwa Isaiah describes both of these and discusses when you'd prefer one over the other. https://www.honeybadger.io/blog/golang-logging/

 Ben Findley

Using Prometheus to collect metrics from Golang applications

In this post, I will talk about a very important feature in the complex projects we work with daily: metrics. Among the various solutions on the market for this purpose, one that has gained more prominence is the duo Prometheus + Grafana.

https://dev.to/codenation/using-prometheus-to-collect-metrics-from-golang-applications-35gc

 Elton Minetto

Golangflow.io - ANNOUNCEMENT

Hello Everyone!

Thank you for contributing to Golangflow.io, all the amazing content. Over the next few weeks, I will be migrating this site to Google Cloud Run in GCP and deploying a few new features. Hopefully, you won't notice the migration :)

 Brian Scott

Go Packages Tutorial for Go Modules

 

How To Check File Exists Using Golang

This golang tutorial help to check the file name is exist or not into the folders.We can pass pattern that will match filename into the target folders.

https://www.golanglearn.com/how-to-check-file-exists-using-golang/

 Adam