Warning, /frameworks/syntax-highlighting/autotests/folding/test.go.fold is written in an unsupported language. File is not indexed.

0001 package main
0002 
0003 import (
0004         "fmt"//TODO remove after testing
0005         "math"
0006         "time"
0007 )
0008 
0009 type inter interface <beginfold id='1'>{</beginfold id='1'>
0010         Function(int) int
0011 <endfold id='1'>}</endfold id='1'>
0012 
0013 type myStruct struct <beginfold id='1'>{</beginfold id='1'>
0014         i int
0015         f float64
0016         neighbors map[string]*uint
0017         comID uint
0018 <endfold id='1'>}</endfold id='1'>
0019 
0020 func co() <beginfold id='1'>{</beginfold id='1'>
0021         fmt.Println("Go")
0022 <endfold id='1'>}</endfold id='1'>
0023 
0024 func co2(c chan float64) <beginfold id='1'>{</beginfold id='1'>
0025         c <- 13.37
0026         close(c)
0027 <endfold id='1'>}</endfold id='1'>
0028 
0029 func main() <beginfold id='1'>{</beginfold id='1'>
0030         defer fmt.Println("Hello KDE!")
0031         value := math.Log2(256)
0032         fmt.Printf("%.1f\n", value)
0033         var mybool bool
0034         mybool = true
0035         if mybool <beginfold id='1'>{</beginfold id='1'>
0036                 mybool = false
0037         <endfold id='1'>}</endfold id='1'> else <beginfold id='1'>{</beginfold id='1'>
0038                 panic("No!")//NOTICE
0039         <endfold id='1'>}</endfold id='1'>
0040         go co()
0041         m:= make(map[string]string)
0042         m["1"] = "2"<beginfold id='2'>/*</beginfold id='2'>Multi
0043         liner<endfold id='2'>*/</endfold id='2'>
0044         for k, v := range m <beginfold id='1'>{</beginfold id='1'>
0045                 m[v] = k
0046         <endfold id='1'>}</endfold id='1'>
0047         switch m["2"] <beginfold id='1'>{</beginfold id='1'>
0048                 case "1":
0049                         mybool = true
0050                 default:
0051                         return
0052         <endfold id='1'>}</endfold id='1'>
0053         ch := make(chan float64)
0054         go co2(ch)
0055         time.Sleep(100*time.Millisecond)
0056         select <beginfold id='1'>{</beginfold id='1'>
0057                 case <-ch:
0058                         fmt.Println("DONE")
0059                 default:
0060                         return
0061         <endfold id='1'>}</endfold id='1'>
0062 <endfold id='1'>}</endfold id='1'>
0063 
0064 var s string = "A string with \x60 a horse \140 \u2014 \U0001F40E"
0065 var s string = "A string with \x6 a horse \400 \u201 \U0001F40"
0066 var s string = "A string with \x6x a horse \400x \u201x \U0001F40x"
0067 var c float32 = imag(987i) + 0o_7_7_7 + 0x1.fp-2 + 0b101010 01 0o21 0x1
0068 var c float32 = imag(0x_987i) + 0o_7_7_7i + 0x1.fp-2i 0b101010 023__
0069 type R[T any, C comparable] struct <beginfold id='1'>{</beginfold id='1'> a T; b C <endfold id='1'>}</endfold id='1'>