---
title: "Discussion on \"[Golang] Test Performance Function Standard - 1\" | Hashnode"
description: "Discussion on \"[Golang] Test Performance Function Standard - 1\". Comparing performance\nreturn error\n\ncreate file return.go\n\nfunc newErr() error {\n    return errors.new(\"this is error\")\n}\nfunc fmtErr() error {\n    return fmt.Errorf(\"this is error\")\n}\n\n\ncreate file return_test.go\n\nfunc BenchmarkNewErr(b *testing.B) ..."
url: "https://hashnode.com/posts/golang-test-performance-function-standard-1/639a78ca9302efdc4ca3f921"
---

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

Discussion

# [\[Golang\] Test Performance Function Standard - 1](https://opendev.hashnode.dev/golang-test-performance-function-standard-1?utm_source=hashnode&utm_medium=feed)

Comparing performance return error create file return.go func newErr() error { return errors.new("this is error") } func fmtErr() error { return fmt.Errorf("this is error") } create file return\_test.go func BenchmarkNewErr(b \*testing.B) ...

Dec 15, 2022 · 2 min read · opendev.hashnode.dev  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#testing](https://hashnode.com/tag/testing)
-   [#performance](https://hashnode.com/tag/performance)
-   [#error-handling](https://hashnode.com/tag/error-handling)

## Written by

[OpenDev](https://hashnode.com/@OpenDev)

@OpenDev · VietNam

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

Golang,Redis,Docker,Reactjs

I am a developer from Vietnamese's

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
