Skip to content

daite/angel

Repository files navigation

example workflow name GoDoc

1. Torrent sites

2. Reference

3. ToDo

4. Sample code

Click to toggle contents of `code`
// Function to update the URL with a maximum number of retries
func updateTorrentURL(key string, url string, maxRetries int, wg *sync.WaitGroup, resultChan chan<- struct {
	key string
	url string
}) {
	defer wg.Done()
	for i := 0; i < maxRetries; i++ {
		if checkURL(url) {
			resultChan <- struct {
				key string
				url string
			}{key, url}
			return
		}
		url = incrementURL(url)
	}
	resultChan <- struct {
		key string
		url string
	}{key, ""} // Indicate failure with an empty string
}

5. How it works (feat.graphviz)

6. Setting Up a Local Homebrew Tap for Your Formula

This guide walks you through setting up a local Homebrew tap and creating a formula to distribute your Go-based application.

Create the directory structure that Homebrew expects for a tap:

mkdir -p ~/homebrew-local/Formula
touch ~/homebrew-local/Formula/angel.rb

Open the angel.rb file in your preferred text editor and add the following content:

class Angel < Formula
  desc "A description of the Angel application"
  homepage "https://github.com/daite/angel"
  url "https://github.com/daite/angel/archive/refs/tags/v1.0.0.tar.gz" # Replace with the actual URL
  sha256 "SHA256_OF_TARBALL" # Replace with the actual SHA256 checksum
  license "MIT"

  depends_on "go" => :build

  def install
    system "go", "build", "-o", bin/"angel", "./cmd/angel"
  end

  test do
    assert_match "angel version", shell_output("#{bin}/angel --version")
  end
end
ln -s ~/homebrew-local /opt/homebrew/Library/Taps/homebrew/homebrew-local
brew install angel

If you ever want to remove the tap:

rm -rf /opt/homebrew/Library/Taps/homebrew/homebrew-local