---
title: "Discussion on \"Mocking Filesystem, File and FileInfo in Golang unit tests\" | Hashnode"
description: "Discussion on \"Mocking Filesystem, File and FileInfo in Golang unit tests\". As a beginner, I found it difficult to write unit tests in GoLang for anything that use actual production resources, like filesystems, APIs, or databases. In this post, I put together my findings in the hope I will save you some time.\nI will show you..."
url: "https://hashnode.com/posts/mocking-filesystem-file-and-fileinfo-in-golang-unit-tests/6300f91e74730d13020f285e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Mocking Filesystem, File and FileInfo in Golang unit tests](https://dguerri.hashnode.dev/mocking-filesystem-file-and-fileinfo-in-golang-unit-tests?utm_source=hashnode&utm_medium=feed)

As a beginner, I found it difficult to write unit tests in GoLang for anything that use actual production resources, like filesystems, APIs, or databases. In this post, I put together my findings in the hope I will save you some time. I will show you...

Aug 20, 2022 · 5 min read · dguerri.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#golang](https://hashnode.com/tag/golang)
-   [#go-testing](https://hashnode.com/tag/go-testing)

## Written by

[Davide Guerri](https://hashnode.com/@dguerri)

@dguerri · Italy

  
[View profile](https://hashnode.com/@dguerri)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
