Outils pour utilisateurs

Outils du site


blog

Notes windows EXE DLL

Appeler une fonction dans une DLL

Avec Go

En ligne de commande

Voir :

wine rundll32.exe user32.dll,MessageBoxW
env LANG="fr_FR.UTF-8" wine rundll32.exe user32.dll,MessageBoxA "Titre de la fenêtre"
2026/04/19 22:39 · Jean-Baptiste

Création image conteneur - exemple de multi-stage builds

Containerfile

FROM golang:latest as builder
WORKDIR /build
COPY ./build/main.go ./
# RUN go mod download
ENV CGO_ENABLED 0
ENV GOOS linux
#RUN CGO_ENABLED=0 go build main.go
RUN go build -ldflags="-s -w" main.go
 
FROM scratch
WORKDIR /app
COPY --from=builder /build/main ./main
EXPOSE 8080
ENTRYPOINT ["./main"]

build/main.go

package main
 
import (
    "fmt"
    "net/http"
)
 
func homeHandler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello World ! \n")
}
 
func main() {
    http.HandleFunc("/", homeHandler)
    http.ListenAndServe(":8080", nil)
}
2026/04/18 17:07 · Jean-Baptiste
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki