Have to create placeholder images in Go project?

Overview of the "Sticket" - a Golang library, that generate placehold images with text 
07 August 2017   1109
Go

Open source project developed by a team at Google and many contributors from the open source community.

All web developers one way or another have to deal with the layout. The task is to harmoniously arrange the content on the page (text, images, video, etc.), make it flexible, responsive, beautiful and appropriate design idea.

Placeholder images help all web developers to make their products pretty and suitable for any screensize. Let's learn how to generate placeholder images in Go project easily.

Sticker is a Go library, that  generate placeholder images with text.

Installation

Make sure you have a working Go environment.

To install sticker, simply run:

go get github.com/muesli/sticker

To execute it from source:

cd $GOPATH/src/github.com/muesli/sticker
go get -u -v
go build && go test -v

Example

gen, err := sticker.NewImageGenerator(sticker.Options{
    TTFPath:         "/usr/share/fonts/TTF/Roboto-Bold.ttf",
    MarginRatio:     0.2,
    Foreground:      color.RGBA{0x96, 0x96, 0x96, 0xff},
    Background:      color.RGBA{0xcc, 0xcc, 0xcc, 0xff},
    BackgroundImage: img,
})
img, err := gen.NewPlaceholder("Lorem ipsum!", 400, 200)
...
 

Sticker will automatically pick a suitable font size, so the text will always fit neatly inside the image.

If you supply a background image, it will automatically be cropped and scaled (while maintaining its original aspect ratio) to the desired output size.

Learn more and download Sticker from GitHub.

GoLand 2018.3 to be Released by JetBrains

New version of IDE for Go programming language has a lot of new features
22 November 2018   373

Team JetBrains introduced a new version of IDE GoLand 2018.3. In this update, users will see:

  • refactoring by changing the signature;
  • memory dump;
  • Testify support;
  • new debugger tools;
  • Improved verification, prediction and code completion;
  • chart support;
  • updates for VCS, Docker, Kubernetes.

The new method of processing the code Change Signature will allow a single action to change the signature of functions and methods throughout the workspace. The function will show what will change in the code after application. The Inline tool will highlight the embedded code, and Rename will notify you of possible conflicts when renaming.

Added the ability to run and debug Google App Engine applications locally.

Go memory dumps are now available via Run / Open Core Dump directly in the IDE. To automatically create memory dumps, you need to enter GOTRACEBACK = crash in the Environment field.

Also, GoLand 2018.3 supports the Mozilla debugger rr, which allows you to search for a crash in the program by playing back its execution.

Get more info at official blog.

The previous version of GoLand 2018.2 was released in July 2018.