Files
RedBear-OS/local/recipes/kde/kf6-syntaxhighlighting/source/autotests/folding/test.go.fold
T

70 lines
2.0 KiB
Plaintext

package main
import (
"fmt"//TODO remove after testing
"math"
"time"
)
type inter interface <beginfold id='1'>{</beginfold id='1'>
Function(int) int
<endfold id='1'>}</endfold id='1'>
type myStruct struct <beginfold id='1'>{</beginfold id='1'>
i int
f float64
neighbors map[string]*uint
comID uint
<endfold id='1'>}</endfold id='1'>
func co() <beginfold id='1'>{</beginfold id='1'>
fmt.Println("Go")
<endfold id='1'>}</endfold id='1'>
func co2(c chan float64) <beginfold id='1'>{</beginfold id='1'>
c <- 13.37
close(c)
<endfold id='1'>}</endfold id='1'>
func main() <beginfold id='1'>{</beginfold id='1'>
defer fmt.Println("Hello KDE!")
value := math.Log2(256)
fmt.Printf("%.1f\n", value)
var mybool bool
mybool = true
if mybool <beginfold id='1'>{</beginfold id='1'>
mybool = false
<endfold id='1'>}</endfold id='1'> else <beginfold id='1'>{</beginfold id='1'>
panic("No!")//NOTICE
<endfold id='1'>}</endfold id='1'>
go co()
m:= make(map[string]string)
m["1"] = "2"<beginfold id='2'>/*</beginfold id='2'>Multi
liner<endfold id='2'>*/</endfold id='2'>
for k, v := range m <beginfold id='1'>{</beginfold id='1'>
m[v] = k
<endfold id='1'>}</endfold id='1'>
switch m["2"] <beginfold id='1'>{</beginfold id='1'>
case "1":
mybool = true
default:
return
<endfold id='1'>}</endfold id='1'>
ch := make(chan float64)
go co2(ch)
time.Sleep(100*time.Millisecond)
select <beginfold id='1'>{</beginfold id='1'>
case <-ch:
fmt.Println("DONE")
default:
return
<endfold id='1'>}</endfold id='1'>
<endfold id='1'>}</endfold id='1'>
var s string = "A string with \x60 a horse \140 \u2014 \U0001F40E"
var s string = "A string with \x6 a horse \400 \u201 \U0001F40"
var s string = "A string with \x6x a horse \400x \u201x \U0001F40x"
var c float32 = imag(987i) + 0o_7_7_7 + 0x1.fp-2 + 0b101010 01 0o21 0x1
var c float32 = imag(0x_987i) + 0o_7_7_7i + 0x1.fp-2i 0b101010 023__
type R[T any, C comparable] struct <beginfold id='1'>{</beginfold id='1'> a T; b C <endfold id='1'>}</endfold id='1'>