search
HomeBackend DevelopmentGolangOpen-Source Development is Amazing!

Table of Contents

  • Introduction
  • First Bad Issue
    • How I tried to fix it?
  • Help Each Other!
  • MatterMost
    • Issue
    • Purpose of The Issue
  • Back To CLI
    • Issue Description
    • What does it mean?
    • Implementation
    • Result
  • Conclusion

Introduction

This blog post is about Release 0.3. I would like to start with a little introduction, explaining how hard was to find a good issue. For the last Release 0.2 I had spent all my time on huge JavaFX project, I wasn't satisfied at all, for the reason that I had to find and close two issues within days. This time I was almost caught by the same problem, but by the end I served it as good as I could. Let me walk you through the time-line.

First Bad Issue

At the beginning, I have found an issue, where I was supposed to move App Icon from Dock to Tray for macOS users. It sounds really simple. However, project is written in Go which I had never used before. If you are a reader that is familiar with my blogs, you definitely know how often I learn new programming-languages. Going forward, I decided to learn Go lang from scratch.

Let me quickly explain what's this project about. This is Simple, free and efficient ad-blocker and privacy guard for Windows, macOS and Linux.

systray - First Attempt

Fortunately, Go is really simple to learn, so let's proceed to my attempts moving the icon from Dock to Tray.

For the first attempt I tried to implement using systray library that is written in Objective-C. It helps manipulate the macOS system UI and move application from Dock to Tray. I've written the code, using documentation within 2 hours, was so happy. However, I've got an issue related to the other library called wails which helps implement UI also written in Objective-C. Eventually, building the project failed, for the reason that these two libraries conflict because they use the same namings. I had to move forward and try different library/method.

trayhost - Second Attempt

Basically, this library works the same way as systray, and I had the same issue.

Any other library to do this works the same way, so I was stacked.

How I tried to fix it?

I forked systray project and changed the naming that caused the conflict. Imported my fork, as Go allows to import directly using git-url.
Unfortunately, it didn't work at all...

You may check my fork and see the changes: Click me :D

Objective-C - Third Attempt

This time I tried to write my code, using Objective-C and Go lang. After some time, I came up with the solution, but I got this error:

r0      0x0
r1      0x0
r2      0x0
r3      0x0
r4      0x18fef62cb
r5      0x16d28db00
r6      0x6e
r7      0x0
r8      0x1e844b5b5be91e5a
r9      0x1e844b5a36c1ee5a
r10     0x200
r11     0xb
r12     0x0
r13     0x1ff800
r14     0x7fb
r15     0xd3c1205a
r16     0x148
r17     0x202129928
r18     0x0
r19     0x6
r20     0x16d28f000
r21     0x1003
r22     0x16d28f0e0
r23     0x2
r24     0x0
r25     0x16d28ecc0
r26     0x1f9a37000
r27     0x828
r28     0x140001021c0
r29     0x16d28da70
lr      0x18ff3ac20
sp      0x16d28da50
pc      0x18ff02a60
fault   0x18ff02a60

The error message indicates that you are attempting to initialize an NSWindow instance outside the main thread, which is not allowed in macOS applications. It was a huge problem, as I couldn't do it in the main thread, for the reason the rest of functionality wouldn't work.

Conclusion of First Bad Issue

Maintainer and I had a small talk where I'd been explaining everything. Eventually, he agreed that is impossible to implement with current project structure... I didn't finish it, and don't have PR :c

Help Each Other!

Open-source community is brilliant because people tend to help each other. I had only a week to finish, so I asked my friend Theo for help. He sent me couple of the repos that he worked on, and I decided to work on them.

MatterMost

MatterMost is an open source platform for secure collaboration across the entire software development lifecycle. It's pretty popular platform and has tons of issues, huge documentation as for users as for developers. It wasn't hard to contribute to this project.

Issue

This time I have taken something that matches my current skill level, and I don't shoot my foot. It was simple issue found in early mentioned mattermost.

Purpose of The Issue

The purpose of that issue is to fix linter errors for one of the files. I set up the project, and started working on it.

First thing first, I had to run linter and see all the errors. I checked the lines where it occurred, and fixed them all pretty quickly. Eventually, opened a PR.

Back To CLI

I really liked working on CLI tools because it's fun to me. For the second PR I found a project called lumen. Lumen is an instant AI Git Commit message, Git changes summary from the CLI. I really enjoyed working on this project! Unfortunately, the don't have that many issues, but I was lucky enough to get assigned. In addition, this tool is written in Rust, so I had to refresh my knowledge.

Issue Description

I found an issue Add STDIN support for explain command.

What does it mean?

This tool has an option explain which is invoked this way:

lumen explain <sha>
</sha>

This command explains everything about certain commit, what it changed and why. Example:

Open-Source Development is Amazing!

Pretty useful tool, huh?

My implementation should allow to add functionality to this command:

echo "HEAD" | lumen explain -

So it takes STDIN value from echo, in my example HEAD, and replaces - with that HEAD value.

Implementation

I realized how to implement it. Created condition to check if - instead of sha.

r0      0x0
r1      0x0
r2      0x0
r3      0x0
r4      0x18fef62cb
r5      0x16d28db00
r6      0x6e
r7      0x0
r8      0x1e844b5b5be91e5a
r9      0x1e844b5a36c1ee5a
r10     0x200
r11     0xb
r12     0x0
r13     0x1ff800
r14     0x7fb
r15     0xd3c1205a
r16     0x148
r17     0x202129928
r18     0x0
r19     0x6
r20     0x16d28f000
r21     0x1003
r22     0x16d28f0e0
r23     0x2
r24     0x0
r25     0x16d28ecc0
r26     0x1f9a37000
r27     0x828
r28     0x140001021c0
r29     0x16d28da70
lr      0x18ff3ac20
sp      0x16d28da50
pc      0x18ff02a60
fault   0x18ff02a60

Result

After changing 5 files, I came up with the result:

Open-Source Development is Amazing!

Now it has two options:

lumen explain <sha>
</sha>

and

echo "HEAD" | lumen explain -

Both of these options are working, my implementation added new functionality, and saved previously implemented! Here's my PR.

Conclusion

Last couple of weeks weren't simple, but was fun. I learnt new language Go. Connected with Open-Source community which helped me to find one of the repos that I contributed to!

The above is the detailed content of Open-Source Development is Amazing!. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Learn Go String Manipulation: Working with the 'strings' PackageLearn Go String Manipulation: Working with the 'strings' PackageMay 09, 2025 am 12:07 AM

Go's "strings" package provides rich features to make string operation efficient and simple. 1) Use strings.Contains() to check substrings. 2) strings.Split() can be used to parse data, but it should be used with caution to avoid performance problems. 3) strings.Join() is suitable for formatting strings, but for small datasets, looping = is more efficient. 4) For large strings, it is more efficient to build strings using strings.Builder.

Go: String Manipulation with the Standard 'strings' PackageGo: String Manipulation with the Standard 'strings' PackageMay 09, 2025 am 12:07 AM

Go uses the "strings" package for string operations. 1) Use strings.Join function to splice strings. 2) Use the strings.Contains function to find substrings. 3) Use the strings.Replace function to replace strings. These functions are efficient and easy to use and are suitable for various string processing tasks.

Mastering Byte Slice Manipulation with Go's 'bytes' Package: A Practical GuideMastering Byte Slice Manipulation with Go's 'bytes' Package: A Practical GuideMay 09, 2025 am 12:02 AM

ThebytespackageinGoisessentialforefficientbyteslicemanipulation,offeringfunctionslikeContains,Index,andReplaceforsearchingandmodifyingbinarydata.Itenhancesperformanceandcodereadability,makingitavitaltoolforhandlingbinarydata,networkprotocols,andfileI

Learn Go Binary Encoding/Decoding: Working with the 'encoding/binary' PackageLearn Go Binary Encoding/Decoding: Working with the 'encoding/binary' PackageMay 08, 2025 am 12:13 AM

Go uses the "encoding/binary" package for binary encoding and decoding. 1) This package provides binary.Write and binary.Read functions for writing and reading data. 2) Pay attention to choosing the correct endian (such as BigEndian or LittleEndian). 3) Data alignment and error handling are also key to ensure the correctness and performance of the data.

Go: Byte Slice Manipulation with the Standard 'bytes' PackageGo: Byte Slice Manipulation with the Standard 'bytes' PackageMay 08, 2025 am 12:09 AM

The"bytes"packageinGooffersefficientfunctionsformanipulatingbyteslices.1)Usebytes.Joinforconcatenatingslices,2)bytes.Bufferforincrementalwriting,3)bytes.Indexorbytes.IndexByteforsearching,4)bytes.Readerforreadinginchunks,and5)bytes.SplitNor

Go encoding/binary package: Optimizing performance for binary operationsGo encoding/binary package: Optimizing performance for binary operationsMay 08, 2025 am 12:06 AM

Theencoding/binarypackageinGoiseffectiveforoptimizingbinaryoperationsduetoitssupportforendiannessandefficientdatahandling.Toenhanceperformance:1)Usebinary.NativeEndianfornativeendiannesstoavoidbyteswapping.2)BatchReadandWriteoperationstoreduceI/Oover

Go bytes package: short reference and tipsGo bytes package: short reference and tipsMay 08, 2025 am 12:05 AM

Go's bytes package is mainly used to efficiently process byte slices. 1) Using bytes.Buffer can efficiently perform string splicing to avoid unnecessary memory allocation. 2) The bytes.Equal function is used to quickly compare byte slices. 3) The bytes.Index, bytes.Split and bytes.ReplaceAll functions can be used to search and manipulate byte slices, but performance issues need to be paid attention to.

Go bytes package: practical examples for byte slice manipulationGo bytes package: practical examples for byte slice manipulationMay 08, 2025 am 12:01 AM

The byte package provides a variety of functions to efficiently process byte slices. 1) Use bytes.Contains to check the byte sequence. 2) Use bytes.Split to split byte slices. 3) Replace the byte sequence bytes.Replace. 4) Use bytes.Join to connect multiple byte slices. 5) Use bytes.Buffer to build data. 6) Combined bytes.Map for error processing and data verification.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version