github.com/gopherjs/gopherjs@v1.19.0-beta1.0.20240506212314-27071a8796e4/internal/govendor/subst/util.go (about) 1 // Copyright 2013 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 subst 6 7 import "go/types" 8 9 // This file defines a number of miscellaneous utility functions. 10 11 //// Sanity checking utilities 12 13 // assert panics with the mesage msg if p is false. 14 // Avoid combining with expensive string formatting. 15 func assert(p bool, msg string) { 16 if !p { 17 panic(msg) 18 } 19 } 20 21 func changeRecv(s *types.Signature, recv *types.Var) *types.Signature { 22 return types.NewSignatureType(recv, nil, nil, s.Params(), s.Results(), s.Variadic()) 23 }