Skip to content

Instantly share code, notes, and snippets.

Last active May 30, 2019
What would you like to do?
Simple Golang snippet which checks for file availability on filesystem - Used in blog
package main
import (
func main() {
err := filepath.Walk("/home/go", func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Printf("Error", err)
return err
if info.Name() == "abc" {
fmt.Println("found: " + path)
return nil
if err != nil {
fmt.Printf("", err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment