Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
github.com/borud/console
Console
is a simple fyne Widget intended for logging messages to a window.
A very simple usage example:
package main
import (
"fmt"
"time"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"github.com/borud/console"
)
func main() {
app := app.New()
win := app.NewWindow("Console test")
win.Resize(fyne.NewSize(1000, 1000))
console := console.NewConsole()
console.ScrollToBottom = true
console.MaxLines = 1000
go func() {
for i := 0; ; i++ {
console.Append(fmt.Sprintf("This is log message %d at %s", i, time.Now().Format(time.RFC3339)))
time.Sleep(500 * time.Millisecond)
}
}()
win.SetContent(console)
win.ShowAndRun()
}
There is a slightly more elaborate example included in cmd/console
which you can build by running
make
This will produce the binary bin/console
.
Note that I'm very new to Fyne so this widget does not seem to be very performant. But if you can live with that (at least until I learn more about Fyne), by all means, use it. If you have ideas on how to improve it, I'd love to hear from you and learn. I made this mostly because I needed the functionality in an application.
You can find me on the Gophers Slack
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.