github.com/ltltlt/go-source-code@v0.0.0-20190830023027-95be009773aa/cmd/compile/internal/gc/testdata/deferNoReturn.go (about) 1 // compile 2 3 // Copyright 2015 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 // Test that a defer in a function with no return 8 // statement will compile correctly. 9 10 package foo 11 12 func deferNoReturn_ssa() { 13 defer func() { println("returned") }() 14 for { 15 println("loop") 16 } 17 }