Skip to content

Commit 7315425

Browse files
committed
made functions private
1 parent 7abc1c5 commit 7315425

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

config/autostart.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ func getLaunchdAgentPath() *paths.Path {
3838
func InstallPlistFile() {
3939
launchdAgentPath := getLaunchdAgentPath()
4040
if !launchdAgentPath.Exist() {
41-
err := WritePlistFile(launchdAgentPath)
41+
err := writePlistFile(launchdAgentPath)
4242
if err != nil {
4343
log.Error(err)
4444
} else {
45-
err = LoadLaunchdAgent() // this will load the agent: basically starting a new instance
45+
err = loadLaunchdAgent() // this will load the agent: basically starting a new instance
4646
if err != nil {
4747
log.Error(err)
4848
} else {
@@ -57,10 +57,10 @@ func InstallPlistFile() {
5757
}
5858
}
5959

60-
// WritePlistFile function will write the required plist file to launchdAgentPath
60+
// writePlistFile function will write the required plist file to launchdAgentPath
6161
// it will return nil in case of success,
6262
// it will error in any other case
63-
func WritePlistFile(launchdAgentPath *paths.Path) error {
63+
func writePlistFile(launchdAgentPath *paths.Path) error {
6464
src, err := os.Executable()
6565

6666
if err != nil {
@@ -81,37 +81,37 @@ func WritePlistFile(launchdAgentPath *paths.Path) error {
8181
return t.Execute(plistFile, data)
8282
}
8383

84-
// LoadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong
85-
func LoadLaunchdAgent() error {
84+
// loadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong
85+
func loadLaunchdAgent() error {
8686
// https://www.launchd.info/
8787
oscmd := exec.Command("launchctl", "load", getLaunchdAgentPath().String())
8888
err := oscmd.Run()
8989
return err
9090
}
9191

9292
func UninstallPlistFile() {
93-
err := UnloadLaunchdAgent()
93+
err := unloadLaunchdAgent()
9494
if err != nil {
9595
log.Error(err)
9696
} else {
97-
err = RemovePlistFile()
97+
err = removePlistFile()
9898
if err != nil {
9999
log.Error(err)
100100
}
101101
}
102102
}
103103

104-
// UnloadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong
105-
func UnloadLaunchdAgent() error {
104+
// unloadLaunchdAgent will use launchctl to load the agent, will return an error if something goes wrong
105+
func unloadLaunchdAgent() error {
106106
// https://www.launchd.info/
107107
oscmd := exec.Command("launchctl", "unload", getLaunchdAgentPath().String())
108108
err := oscmd.Run()
109109
return err
110110
}
111111

112-
// RemovePlistFile function will remove the plist file from $HOME/Library/LaunchAgents/ArduinoCreateAgent.plist and return an error
112+
// removePlistFile function will remove the plist file from $HOME/Library/LaunchAgents/ArduinoCreateAgent.plist and return an error
113113
// it will not do anything if the file is not there
114-
func RemovePlistFile() error {
114+
func removePlistFile() error {
115115
launchdAgentPath := getLaunchdAgentPath()
116116
if launchdAgentPath.Exist() {
117117
log.Infof("removing: %s", launchdAgentPath)

0 commit comments

Comments
 (0)