| --- |
| title: UnusedResults |
| layout: article |
| --- |
| <!-- Copyright 2023 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. --> |
| |
| <!-- Code generated by generrordocs.go; DO NOT EDIT. --> |
| |
| ``` |
| UnusedResults occurs when a restricted expression-only built-in function |
| is suspended via go or defer. Such a suspension discards the results of |
| these side-effect free built-in functions, and therefore is ineffectual. |
| |
| Example: |
| func f(a []int) int { |
| defer len(a) |
| return i |
| } |
| ``` |
| |