-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to show dominikh/go-augeas#13
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
- Loading branch information
0 parents
commit dca84f5
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"honnef.co/go/augeas" | ||
|
||
"fmt" | ||
) | ||
|
||
func main() { | ||
ag, err := augeas.New("/", "", augeas.None) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
err = ag.Set("/augeas/load/Xmgmt/lens", "Sshd.lns") | ||
if err != nil { | ||
panic("err on set lens") | ||
} | ||
err = ag.Set("/augeas/load/Xmgmt/incl", "/tmp/foo/bar") | ||
if err != nil { | ||
panic("err on set incl") | ||
} | ||
err = ag.Load() | ||
if err != nil { | ||
panic("err on load") | ||
} | ||
err = ag.Set("/files/tmp/foo/bar/X11Forwarding", "no") | ||
if err != nil { | ||
panic("err on set x11forward") | ||
} | ||
err = ag.Save() | ||
if err != nil { | ||
panic(err) | ||
} | ||
fmt.Println("Done!") | ||
} |