github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/addrs/self.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package addrs
     5  
     6  // Self is the address of the special object "self" that behaves as an alias
     7  // for a containing object currently in scope.
     8  const Self selfT = 0
     9  
    10  type selfT int
    11  
    12  func (s selfT) referenceableSigil() {
    13  }
    14  
    15  func (s selfT) String() string {
    16  	return "self"
    17  }
    18  
    19  func (s selfT) UniqueKey() UniqueKey {
    20  	return Self // Self is its own UniqueKey
    21  }
    22  
    23  func (s selfT) uniqueKeySigil() {}