Examples · learn/18-approval · 230 of 339
approve
tin run examples/learn/18-approval/approve.tin/// Permanently delete a file.
guarded tool fn deleteFile(path: string): string => "deleted {path}"
fn main() {
// approve shows a person the exact call, and runs it only on a yes
match approve deleteFile("draft.md") {
Ok(msg) => print(msg)
Err(why) => print("not done: {why}")
}
}