github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/link/internal/ld/testdata/issue10978/main.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  func undefined()
     8  
     9  func defined1() int {
    10  	// To check multiple errors for a single symbol,
    11  	// reference undefined more than once.
    12  	undefined()
    13  	undefined()
    14  	return 0
    15  }
    16  
    17  func defined2() {
    18  	undefined()
    19  	undefined()
    20  }
    21  
    22  func init() {
    23  	_ = defined1()
    24  	defined2()
    25  }
    26  
    27  // The "main" function remains undeclared.