ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/golang/1.22.0/src/cmd/go/testdata/script/build_static.txt
[short] skip 'links and runs binaries'

# This test requires external linking. Assume that if cgo is supported
# then external linking works.
[!cgo] skip 'requires a C linker'

# Only run on Unix systems.
[GOOS:windows] skip
[GOOS:plan9] skip

# Ordinary build should work.
go build
exec ./hello
stdout Hello

# Building with -linkmode=external should not say anything about
# runtime/cgo (issue #31544).
go build -ldflags=-linkmode=external
! stderr runtime/cgo
exec ./hello
stdout Hello

# Some targets don't support -static
[GOOS:darwin] skip 'no static linking on Darwin'
[GOOS:solaris] skip 'no static linking on Solaris'

# Building with -linkmode=external -extldflags=-static should work.
go build -ldflags='-linkmode=external -extldflags=-static'
! stderr runtime/cgo
exec ./hello
stdout Hello

-- go.mod --
module hello

go 1.20
-- hello.go --
package main

import "fmt"

func main() {
	fmt.Println("Hello, world")
}