macos

package
v2.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 2 Imported by: 0

README

goutils/v2/macos

The macos package is a collection of utility functions designed to simplify common macos tasks.


Table of contents


Functions

InstallBrewDeps([]string)
InstallBrewDeps([]string) error

InstallBrewDeps executes brew install for the input packages. If any installation fails, it returns an error.

Parameters:

brewPackages: Slice of strings representing the packages to install.

Returns:

error: An error if any package fails to install.


InstallBrewTFDeps()
InstallBrewTFDeps() error

InstallBrewTFDeps installs dependencies for terraform projects using homebrew. The dependencies include several shell and terraform tools. If any installation fails, it returns an error.

Returns:

error: An error if any package fails to install.


Installation

To use the goutils/v2/macos package, you first need to install it. Follow the steps below to install via go get.

go get github.com/l50/goutils/v2/macos

Usage

After installation, you can import the package in your Go project using the following import statement:

import "github.com/l50/goutils/v2/macos"

Tests

To ensure the package is working correctly, run the following command to execute the tests for goutils/v2/macos:

go test -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallBrewDeps

func InstallBrewDeps(brewPackages []string) error

InstallBrewDeps executes brew install for the input packages. If any installation fails, it returns an error.

**Parameters:**

brewPackages: Slice of strings representing the packages to install.

**Returns:**

error: An error if any package fails to install.

Example
package main

import (
	"log"

	"github.com/l50/goutils/v2/macos"
)

func main() {
	brewPackages := []string{"shellcheck", "shfmt"}
	err := macos.InstallBrewDeps(brewPackages)
	if err != nil {
		log.Fatalf("failed to install brew dependencies: %v", err)
	}
}
Output:

func InstallBrewTFDeps

func InstallBrewTFDeps() error

InstallBrewTFDeps installs dependencies for terraform projects using homebrew. The dependencies include several shell and terraform tools. If any installation fails, it returns an error.

**Returns:**

error: An error if any package fails to install.

Example
package main

import (
	"log"

	"github.com/l50/goutils/v2/macos"
)

func main() {
	err := macos.InstallBrewTFDeps()
	if err != nil {
		log.Fatalf("failed to install terraform brew dependencies: %v", err)
	}
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL